File tree 2 files changed +1
-14
lines changed
2 files changed +1
-14
lines changed Original file line number Diff line number Diff line change @@ -1125,14 +1125,6 @@ def __new__(cls, value):
1125
1125
def __init__ (self , * args , ** kwds ):
1126
1126
pass
1127
1127
1128
- def __getattribute__ (self , name ):
1129
- self_dict = super ().__getattribute__ ('__dict__' )
1130
- cls = super ().__getattribute__ ('__class__' )
1131
- value = super ().__getattribute__ (name )
1132
- if isinstance (value , cls ) and name not in self_dict and name in self ._member_names_ :
1133
- raise AttributeError ("<enum '%s'> member has no attribute %r" % (cls .__name__ , name ))
1134
- return super ().__getattribute__ (name )
1135
-
1136
1128
def _generate_next_value_ (name , start , count , last_values ):
1137
1129
"""
1138
1130
Generate the next value when not given.
Original file line number Diff line number Diff line change @@ -2611,19 +2611,14 @@ class Private(Enum):
2611
2611
self .assertEqual (Private ._Private__corporal , 'Radar' )
2612
2612
self .assertEqual (Private ._Private__major_ , 'Hoolihan' )
2613
2613
2614
+ @unittest .skip ("Accessing all values retained for performance reasons, see GH-93910" )
2614
2615
def test_exception_for_member_from_member_access (self ):
2615
2616
with self .assertRaisesRegex (AttributeError , "<enum .Di.> member has no attribute .NO." ):
2616
2617
class Di (Enum ):
2617
2618
YES = 1
2618
2619
NO = 0
2619
2620
nope = Di .YES .NO
2620
2621
2621
- def test_no_exception_for_overridden_member_from_member_access (self ):
2622
- class Di (Enum ):
2623
- YES = 1
2624
- NO = 0
2625
- Di .YES .NO = Di .NO
2626
- nope = Di .YES .NO
2627
2622
2628
2623
def test_dynamic_members_with_static_methods (self ):
2629
2624
#
You can’t perform that action at this time.
0 commit comments