New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enum] standardize format() behavior #88111
Comments
Currently, an enum with a mixed-in data type, such as IntEnum, will use that data type's This behavior will be deprecated in 3.10, and in 3.12 the default For those that were relying on, for example, class Color(IntEnum):
RED = 1
They will need to add ":d" to ensure the integer output:
This change does work now. |
Thinking about this some more I am partially reversing course. The idea behind So it won't. Instead, any user-mixed enumerations will get the new behavior: class Grades(int, Enum):
A = 5
F = 0 will emit a DeprecationWarning now, and in 3.12 |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: