Closed
Description
Bug report
The str()
method on Python 3.11.0b4 is outputting the raw integer value not the class name and label that older Python versions do.
import enum
class MyEnum(enum.IntEnum):
TEST = 1
assert str(MyEnum.TEST) == "MyEnum.TEST", f"Actual '{MyEnum.TEST}'"
On Python 3.10 (and older Python 3 versions) this assertion is true. On python 3.11.0b4 the str value is just 1
.
The repr()
is the same as on older versions, just seems like str()
is affected.
Your environment
- CPython versions tested on: 3.11.0b4
- Operating system and architecture: Linux (should be N/A though)