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-45535: Improve output of Enum dir()#29316
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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
13 commits Select commit Hold shift + click to select a range
0ed36bc bpo-45535: Improve output of Enum ``dir()``
AlexWaygood bb4c147 Simplify Enum.__dir__ slightly
AlexWaygood 526d88b Simplify diff from upstream a little
AlexWaygood bd30c46 Update enum.py
AlexWaygood 782f3c7 Further simplify diff
AlexWaygood 24e8968 Merge branch 'Enum-dir-improvements' of https://github.com/AlexWaygoo…
AlexWaygood 6dc0ec0 Lookup via __dict__ for non-EnumType classes
AlexWaygood f5f80ad Small tweaks
AlexWaygood 6d182a0 More tweaks
AlexWaygood 6b22112 Improve tests w.r.t. classmethods
AlexWaygood baa8477 More test tweaks
AlexWaygood f307b22 Another small tweak
AlexWaygood ce02230 Only use a single sentinel
AlexWaygood File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Does
__init__need to be here? It will never be called after the enum class is created.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.
surface_gravityis here so completion works?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.
I think having
__init__show up ondir(Planet)improves the output ofhelp(Planet.EARTH). Without__init__being present ondir(Planet), there is no reference in the output fromhelp(Planet.EARTH)to the fact that the member has two named attributes,massandradius. With__init__being present ondir(Planet), however, the signature of the__init__function shows up in the output ofhelp(Planet.EARTH), so we can clearly see that the member has two named attributes,massandradius.