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
However in Python 3.7/8 it instead prints
It uses HexInt's repr instead of Enum's. Looking at the enum.py module it seems that this occurs for mixin classes that don't define __new__ due to a change in the _get_mixins_ method. If I define a __new__ method on the HexInt class then the expected behavior occurs.
Yes, the change only considered types with their own copy of __new__ to be actual data types, so in 3.6 HexInt was the recognized data type, but in 3.7+ it was int -- which also meant that HexEnum was considered a simple mix-in and its __repr__ was used instead of Enum.__repr__.