Message404069
See below example, which shows Python 3.11 repr(enum) == Python 3.10 str(enum).
The enum module documentation lists various enhancements in 3.11, but not this.
And the what's new? documentation of 3.11 doesn't mention enum at all.
Either this is by intent, and then should be documented incl. breaking old code depending on representation, or is by accident, and then merits fixing (which is what alphas are for).
> py -3.10 enum_test.py
3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)]
ABC.a ABC.b ABC.c ABC.a <ABC.a: 1>
> py -3.11 enum_test.py
3.11.0a1 (tags/v3.11.0a1:7c12e48, Oct 5 2021, 15:38:19) [MSC v.1929 64 bit (AMD64)]
a b c a ABC.a
> more enum_test.py
import enum
import sys
class ABC(enum.Enum):
a = enum.auto()
b = enum.auto()
c = enum.auto()
print(sys.version)
print(*ABC, str(ABC.a), repr(ABC.a)) |
|
Date |
User |
Action |
Args |
2021-10-16 10:58:57 | Dutcho | set | recipients:
+ Dutcho |
2021-10-16 10:58:57 | Dutcho | set | messageid: <1634381937.08.0.264995167777.issue45493@roundup.psfhosted.org> |
2021-10-16 10:58:57 | Dutcho | link | issue45493 messages |
2021-10-16 10:58:56 | Dutcho | create | |
|