-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Crash with TypeVar with bound and @dataclass #10705
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
Comments
Hello. Please, explain:
As for me: I didn't see any error in that behavior in this code, because its strange, because there no forward declaration. P.S. Sorry for my awful language, its not my native. |
Well, I think that mypy shouldn't crash no matter the code.
As said above, it shouldn't crash, no matter the code. This particular example is a bit weird, since type T is not used inside A, and I don't remember exactly why I needed it (my real use case was more complicated and here I posted minimal reproducible code). Also, as said in the post, moving TypeVar after class X, makes everything fine, so it makes sense that everything should be fine in this specific order as well. I hope this gives a bit more clarity. |
Thanks for explanation. I definitely agree with this:
|
Thanks for reporting, duplicate of #10140 |
Crash Report
I experienced the crash when using some (I guess uncommon) combination of:
Traceback
To Reproduce
Few things that don't make it crash:
T = TypeVar(...)
afterClass X:
Your Environment
mypy.ini
(and other config files): N/AThe text was updated successfully, but these errors were encountered: