-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Description
The __dir__
methods for EnumType
/EnumMeta
and Enum
were changed in Python 3.11, but the documentation hasn't been updated. For example:
Lines 1053 to 1056 in a2a4b9f
>>> dir(Planet) # doctest: +SKIP | |
['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', 'VENUS', '__class__', '__doc__', '__members__', '__module__'] | |
>>> dir(Planet.EARTH) # doctest: +SKIP | |
['__class__', '__doc__', '__module__', 'mass', 'name', 'radius', 'surface_gravity', 'value'] |
The actual output (for Python 3.11+) is:
>>> dir(Planet)
['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', 'VENUS', '__class__', '__contains__', '__doc__', '__getitem__', '__init_subclass__', '__iter__', '__len__', '__members__', '__module__', '__name__', '__qualname__']
>>> dir(Planet.EARTH)
['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', 'VENUS', '__class__', '__doc__', '__eq__', '__hash__', '__module__', 'mass', 'name', 'radius', 'surface_gravity', 'value']
There are other examples with incorrect outputs in Doc/library/enum.rst.
Linked PRs
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir