GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||
GeezerVison is showing github.com — bpo-40066: [Enum] update str() and format() output by ethanfurman · Pull Request #30582 · python/cpython Conversation
| ||||||||||||||||||||||||||||
|
Omg, did not mean to close that at all — sorry!! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
4da9925 to
d36aeda
Compare
|
This change appears to be causing CI to fail on docs for unrelated PRs |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ythonGH-30582)" (pythonGH-30632)" This reverts commit 42a64c0.
|
I'm curious: why does this define a It causes pylint to start throwing warnings about subclasses of Enum which have their own |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -2567,30 +2567,28 @@ class _empty: | |||
|
|
|||
|
|
|||
| class _ParameterKind(enum.IntEnum): | |||
There was a problem 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?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem 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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if invalid_names: | ||
| raise ValueError('Invalid enum member name: {0}'.format( | ||
| ','.join(invalid_names))) | ||
| raise ValueError('invalid enum member name(s) '.format( |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Is removing "{0}" proper?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.