You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee='https://github.com/ethanfurman'closed_at=<Date2020-12-08.03:21:43.846>created_at=<Date2020-09-30.04:21:36.560>labels= ['3.8', 'type-bug', 'library', '3.9', '3.10']
title='enum: Mixin and int base class regression in 3.8.6'updated_at=<Date2020-12-08.03:21:43.845>user='https://github.com/puddly'
The following code worked in 3.8.5 but does not in 3.8.6 due to the fix for bpo-39587:
def __new__(cls, value):
return super().__new__(cls, value)
class MyIntEnum(HexMixin, MyInt, enum.Enum):
TEST = 1
assert isinstance(Foo.TEST, MyInt)
assert repr(Foo.TEST) == "0x1"
In 3.8.6, the Foo enum itself fails to be created because HexMixin is now considered the member type instead of MyInt:
Traceback (most recent call last):
File "enum_test.py", line 18, in <module>
File "/usr/local/Cellaremail@example.com/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/enum.py", line 215, in __new__
enum_member = __new__(enum_class)
TypeError: object.__new__(Foo) is not safe, use int.__new__()