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
{{ message }}
Repository navigation
It seems that enum.Enum.__init__ serves no purpose #128080
Enum gained an __init__ method in 3.11 which just passes:
def__init__(self, *args, **kwds):
pass
That was added in #30582. One person questioned it at the time, but there was no response. The best I can figure is that it was related to special handling of __init__ in EnumType.__dir__, which you can see here:
That special handling of __init__ was removed by #30677 prior to 3.11 being released, which leaves no plausible function to Enum.__init__ that I can see. It muddies introspection of the type, so I think we should remove it if that's really the case.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Activity
gh-128080: remove unnecessary `__init__` method from Enum (GH-128081)
pythongh-128080: remove unnecessary `__init__` method from Enum (pyth…
pythongh-128080: remove unnecessary `__init__` method from Enum (pyth…