-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Fix mishandling of typing.Self in attrs generated inits #14689
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
The test run seems a bit confusing, as locally, it succeeds (outside of the test suite). Is it possible that the test have some configuration that may cause the behaviour to change? (Looking more towards |
You can specify flags at the top of the test ( Additionally I think this |
The flag didn't seem to do much, specially given that it seems to be the default since mypy 0.600 (as per https://mypy.readthedocs.io/en/stable/kinds_of_types.html#no-strict-optional) This is really confusing, but I will have another look later |
@A5rocks you were actually right with the flag, i just seemed to have typed I also merged similar code function as you pointed out. Hope it looks good :) |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! A few comments and questions below.
This comment has been minimized.
This comment has been minimized.
@JukkaL Addressed one of your points and got questions about the other ones :) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
Fix mishandling of
typing.Self
inattrs
generated inits by using the same expansion method as thedataclasses
pluginFixes #14685