summaryrefslogtreecommitdiffstats
path: root/Lib/enum.py
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2022-07-18 20:56:21 (GMT)
committerGitHub <noreply@github.com>2022-07-18 20:56:21 (GMT)
commitbe84daf52aec7b963a743d0c2d66dbd175810803 (patch)
treec3c67c05291dc90d3057b178fed3562541ae93a6 /Lib/enum.py
parenteda2f90094731a7a1a30bc4a50a6c1bc050a4b2c (diff)
downloadcpython-be84daf52aec7b963a743d0c2d66dbd175810803.zip
cpython-be84daf52aec7b963a743d0c2d66dbd175810803.tar.gz
cpython-be84daf52aec7b963a743d0c2d66dbd175810803.tar.bz2
Revert "gh-93910: [Enum] restore member.member restriction while keeping performance boost (GH-94913)" (#94981)
This reverts commit 30f28ac296e506b336e0ab56c41422a53c36d0c2.
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 f5c29ed..63ca160 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -1125,14 +1125,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.