Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
bpo-40066: [Enum] update str() and format() output#30582
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
ethanfurman commented Jan 13, 2022 • edited by bedevere-bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by bedevere-bot
Uh oh!
There was an error while loading. Please reload this page.
AlexWaygood commented Jan 13, 2022
Omg, did not mean to close that at all — sorry!! |
sobolevn left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work! Enums' text representation looks way better now.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
4da9925 to d36aedaCompareAlexWaygood commented Jan 16, 2022
This change appears to be causing CI to fail on docs for unrelated PRs |
…ythonGH-30582)" (pythonGH-30632)" This reverts commit 42a64c0.
AdamWill commented Jul 11, 2022
I'm curious: why does this define a It causes pylint to start throwing warnings about subclasses of Enum which have their own |
| """Marker object for Signature.empty and Parameter.empty.""" | ||
| class_ParameterKind(enum.IntEnum): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that inheritting correct where the values are changed to str?
ethanfurmanNov 25, 2022 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gryznar Good question: only because the __new__ uses integers as the values, and the "value" on the assignment line is saved in the description attribute. Without the custom __new__ the enum creation would have failed, since strings are not integers.
| ifinvalid_names: | ||
| raiseValueError('Invalid enum member name:{0}'.format( | ||
| ','.join(invalid_names))) | ||
| raiseValueError('invalid enum member name(s) '.format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is removing "{0}" proper?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gryznar Only because it was changed to %s later.
https://bugs.python.org/issue40066