-
-
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
pre-release v0.920 incorrectly identifies enum as final #11578
Comments
@sobolevn not sure if checking for initialized values would be trival to follow up with on your PR, but figured I'd ask you before looking into it myself. |
This example raises: from enum import Enum
class A(Enum):
x: int
y: int
class B(A):
x = 1
y = 2
print(B.x, B.y) # Runtime print: B.x, B.y Output:
So, this is a bug I guess. I will try to solve this right now. |
The first one is quite easy to solve. But, I am not sure what to do with the 2nd and 3rd 🤔 |
Thanks for checking, I figured it didn't, but I wanted to make sure the example matched my particular code. |
I'd like to reopen this issue, as mypy 0.930 release still gives me this error when inheriting a subclass (a custom |
@achimnol please, open a new one with a repro example. I would be happy to fix it 🙂 |
Bug Report
Mypy incorrectly identifies an enum as final. This appears related to / caused by #11247.
To Reproduce
__new__
methodExpected Behavior
Mypy would not complain about the enum.
Actual Behavior
error: Cannot inherit from final class "TestEnum" [misc]
Your Environment
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: