-
-
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
Regression from 0.660 when importing from aiohttp #6364
Comments
OK this one is actually a pretty wild ride. The tldr is that we (accidentally?) fixed a bug in which The minimized version of the regression is this:
This fails with a message that And since this is obviously just a bug, there are cases that it allows and should not:
|
So I think the possible paths forward are:
It would also be possible to interpret aiohttp's dynamic Then the other question is whether this is worth a 0.671 release if we go with option 2. |
I am also leaning towards option 2. |
Agreed on option 2. |
I also created a minimal test case for this bug, because I didn't realize it had already been reported: https://github.com/saulshanabrook/minimal_mypy_import. I verified MyPy errors on this example in |
mypy -c 'from aiohttp import ClientRequest'
with aiohttp==3.4.4 fails on mypy 0.670 but passes on mypy 0.660.Bisect shows the culprit to be #6256 and in particular I think to be https://github.com/python/mypy/pull/6256/files#diff-cc0809c072977e8bf33796c4b2c3a823R323.
Not totally sure what all the components involved in the issue are. PEP 561 was suspected but I now think that was a red herring. Star imports are definitely involved and I think
__all__
as wellThe text was updated successfully, but these errors were encountered: