Closed
Description
Bug report
The following script changes output between 3.10.4 (and earlier) to 3.11.0b1.
import enum
class E(str, enum.Enum):
A = "A"
print("hello {0}".format(E.A))$ python3.10 test.py
hello A
$ python3.11 test.py
hello E.A
Per https://docs.python.org/3/library/enum.html, I believe 3.11's behavior is wrong:
Formatted string literals, str.format(), and format() will use the mixed-in type’s
__format__()unless__str__()or__format__()is overridden in the subclass
Your environment
- CPython versions tested on: 3.10.4 and 3.11.0b1
- Operating system and architecture: the docker images
python:3.10-alpineandpython:3.11-rc-alpine, on an x86_64 host

