Revert "gh-93910: [Enum] restore member.member restriction while keeping performance boost (GH-94913)" (#94985)

This reverts commit c20186c397.
This commit is contained in:
Ethan Furman 2022-07-18 13:22:52 -07:00 committed by GitHub
parent 4b5360c7d5
commit 73eab9f35c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 14 deletions

View file

@ -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.