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

(cherry picked from commit 68526fe258)

Co-authored-by: Angelin BOOZ <9497359+lem2clide@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2020-12-14 14:43:43 -08:00 committed by GitHub
parent dbb00062dc
commit 33cbb04986
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 2 deletions

View file

@ -699,7 +699,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):