-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overriding non-enumeration attributes in Enum subclass fails #12132
Labels
Comments
@flaeppe are you interested in working on this? 🙂 |
I could take a swing at it if I find some time, though I'm not too familiar with mypy code so I'm not sure what'll come out of it. If someone else feels like working on it, please go ahead |
8 tasks
JukkaL
pushed a commit
that referenced
this issue
Mar 22, 2022
Allows any dunder (`__name__`) attributes except `__members__` (due to it being read-only) to be overridden in enum subclasses. Fixes #12132.
JukkaL
pushed a commit
that referenced
this issue
Mar 22, 2022
Allows any dunder (`__name__`) attributes except `__members__` (due to it being read-only) to be overridden in enum subclasses. Fixes #12132.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
Inheriting an
Enum
-class and overriding, for example, a dunder-attribute fails to typecheck. Although it works fine during runtime.To Reproduce
Expected Behavior
It should typecheck, as it passes during runtime.
Actual Behavior
Your Environment
master
(26fdd45)mypy.ini
(and other config files):3.9.4
10.15.6
The issue has also been briefly mentioned in these places:
Enum
types cannot be inherited #10857 (comment)The text was updated successfully, but these errors were encountered: