Skip to content

Commit 817a6bc

Browse files
authored
bpo-46269: [Enum] remove special-casing of __new__ in EnumType.__dir__ (GH-30421)
1 parent 43aac29 commit 817a6bc

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

Lib/enum.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -652,10 +652,6 @@ def __dir__(self):
652652
# if and only if they have been user-overridden
653653
enum_dunders = set(filter(_is_dunder, enum_dict))
654654

655-
# special-case __new__
656-
if self.__new__ is not first_enum_base.__new__:
657-
add_to_dir('__new__')
658-
659655
for cls in mro:
660656
# Ignore any classes defined in this module
661657
if cls is object or is_from_this_module(cls):
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove special-casing of ``__new__`` in :meth:`enum.Enum.__dir__`.

0 commit comments

Comments
 (0)