bpo-40084: Enum - dir() includes member attributes (GH-19219)

This commit is contained in:
Angelin BOOZ 2020-09-21 15:11:06 +02:00 committed by GitHub
parent 1b328ea9a7
commit 68526fe258
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 2 deletions

View file

@ -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):