summaryrefslogtreecommitdiffstats
path: root/Lib/enum.py
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2022-07-18 20:22:52 (GMT)
committerGitHub <noreply@github.com>2022-07-18 20:22:52 (GMT)
commit73eab9f35ca17c7c3b813c717673934b0ab8ed64 (patch)
tree187a3588908ea0173f543f38aacc3a29a1077a98 /Lib/enum.py
parent4b5360c7d5ad3c5452782ebd7e40f82cc32a39e1 (diff)
downloadcpython-73eab9f35ca17c7c3b813c717673934b0ab8ed64.zip
cpython-73eab9f35ca17c7c3b813c717673934b0ab8ed64.tar.gz
cpython-73eab9f35ca17c7c3b813c717673934b0ab8ed64.tar.bz2
Revert "gh-93910: [Enum] restore member.member restriction while keeping performance boost (GH-94913)" (#94985)
This reverts commit c20186c3972ff38577c4c5e32ca86748210983d2.
Diffstat (limited to 'Lib/enum.py')
-rw-r--r--Lib/enum.py8
1 files changed, 0 insertions, 8 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index 80945c1..935e2bd 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -1112,14 +1112,6 @@ class Enum(metaclass=EnumType):
def __init__(self, *args, **kwds):
pass
- def __getattribute__(self, name):
- self_dict = super().__getattribute__('__dict__')
- cls = super().__getattribute__('__class__')
- value = super().__getattribute__(name)
- if isinstance(value, cls) and name not in self_dict and name in self._member_names_:
- raise AttributeError("<enum '%s'> member has no attribute %r" % (cls.__name__, name))
- return super().__getattribute__(name)
-
def _generate_next_value_(name, start, count, last_values):
"""
Generate the next value when not given.