-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
gh-107957: Fix dir()
sample output in enum
docs
#107958
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
Changes from all commits
70c1089
77269f8
0dc0ab7
bca1c36
20cbcd3
98d0f2d
2e067a4
848dd18
722550f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -1051,9 +1051,13 @@ class below, those methods will show up in a :func:`dir` of the member, | |||||||
but not of the class:: | ||||||||
|
||||||||
>>> dir(Planet) # doctest: +SKIP | ||||||||
['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', 'VENUS', '__class__', '__doc__', '__members__', '__module__'] | ||||||||
['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', 'VENUS', '__class__', '__contains__', '__doc__', '__getitem__', '__init_subclass__', '__iter__', '__len__', '__members__', '__module__', '__name__', '__qualname__'] | ||||||||
>>> dir(Planet.EARTH) # doctest: +SKIP | ||||||||
['__class__', '__doc__', '__module__', 'mass', 'name', 'radius', 'surface_gravity', 'value'] | ||||||||
['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', 'VENUS', '__class__', '__doc__', '__eq__', '__hash__', '__module__', 'mass', 'name', 'radius', 'surface_gravity', 'value'] | ||||||||
|
||||||||
.. versionchanged:: 3.11 | ||||||||
Additional ``__dunder__`` names are returned for enums and enum members. | ||||||||
Calling :func:`dir` on an enum member also returns the other members. | ||||||||
Comment on lines
+1058
to
+1060
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need versionchanged in a How To document
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should I remove it? Note that there are 13 other occurrences of versionadded/versionchanged in the document |
||||||||
|
||||||||
|
||||||||
Combining members of ``Flag`` | ||||||||
|
Uh oh!
There was an error while loading. Please reload this page.