mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
bpo-40084: Enum - dir() includes member attributes (GH-19219)
This commit is contained in:
parent
1b328ea9a7
commit
68526fe258
5 changed files with 20 additions and 2 deletions
|
@ -644,7 +644,7 @@ class Enum(metaclass=EnumMeta):
|
|||
for cls in self.__class__.mro()
|
||||
for m in cls.__dict__
|
||||
if m[0] != '_' and m not in self._member_map_
|
||||
]
|
||||
] + [m for m in self.__dict__ if m[0] != '_']
|
||||
return (['__class__', '__doc__', '__module__'] + added_behavior)
|
||||
|
||||
def __format__(self, format_spec):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue