@@ -668,19 +668,11 @@ enum
668
668
for :meth: `~object.__str__ ` and :meth: `~object.__format__ `
669
669
(used by :func: `str `, :func: `format ` and :term: `f-string `\s ).
670
670
671
- * Changed :class: `~enum.IntEnum `, :class: `~enum.IntFlag ` and :class: `~enum.StrEnum `
672
- to now inherit from :class: `~enum.ReprEnum `,
673
- so their :func: `str ` output now matches :func: `format `
674
- (both ``str(AnIntEnum.ONE) `` and ``format(AnIntEnum.ONE) `` return ``'1' ``,
675
- whereas before ``str(AnIntEnum.ONE) `` returned ``'AnIntEnum.ONE' ``.
676
-
677
- * Changed :meth: `Enum.__format__() <enum.Enum.__format__> `
678
- (the default for :func: `format `, :meth: `str.format ` and :term: `f-string `\s )
679
- of enums with mixed-in types (e.g. :class: `int `, :class: `str `)
680
- to also include the class name in the output, not just the member's key.
681
- This matches the existing behavior of :meth: `enum.Enum.__str__ `,
682
- returning e.g. ``'AnEnum.MEMBER' `` for an enum ``AnEnum(str, Enum) ``
683
- instead of just ``'MEMBER' ``.
671
+ * Changed :meth: `Enum.__format__() <enum.Enum.__format__> ` (the default for
672
+ :func: `format `, :meth: `str.format ` and :term: `f-string `\s ) to always produce
673
+ the same result as :meth: `Enum.__str__() `: for enums inheriting from
674
+ :class: `~enum.ReprEnum ` it will be the member's value; for all other enums
675
+ it will be the enum and member name (e.g. ``Color.RED ``).
684
676
685
677
* Added a new *boundary * class parameter to :class: `~enum.Flag ` enums
686
678
and the :class: `~enum.FlagBoundary ` enum with its options,
0 commit comments