Skip to content

bpo-46269: remove special-casing of __new__ in Enum.__dir__ #30421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Lib/enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,10 +652,6 @@ def __dir__(self):
# if and only if they have been user-overridden
enum_dunders = set(filter(_is_dunder, enum_dict))

# special-case __new__
if self.__new__ is not first_enum_base.__new__:
add_to_dir('__new__')

for cls in mro:
# Ignore any classes defined in this module
if cls is object or is_from_this_module(cls):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove special-casing of ``__new__`` in :meth:`enum.Enum.__dir__`.