[Python-checkins] gh-103215: Remove redundant if stmt from `enum.EnumType._find_data_type_` (GH-103222)

ethanfurman webhook-mailer at python.org
Mon Apr 3 17:51:50 EDT 2023


https://github.com/python/cpython/commit/d3a7732dd54c27ae523bef73efbb0c580ce2fbc0
commit: d3a7732dd54c27ae523bef73efbb0c580ce2fbc0
branch: main
author: Sadra Barikbin <sadraqazvin1 at yahoo.com>
committer: ethanfurman <ethan at stoneleaf.us>
date: 2023-04-03T14:51:43-07:00
summary:

gh-103215: Remove redundant if stmt from `enum.EnumType._find_data_type_` (GH-103222)

files:
M Lib/enum.py

diff --git a/Lib/enum.py b/Lib/enum.py
index 4e231e7e8ea7..b8ea7af9e747 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -987,8 +987,6 @@ def _find_data_type_(mcls, class_name, bases):
                         data_types.add(base._member_type_)
                         break
                 elif '__new__' in base.__dict__ or '__init__' in base.__dict__:
-                    if isinstance(base, EnumType):
-                        continue
                     data_types.add(candidate or base)
                     break
                 else:



More information about the Python-checkins mailing list