-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Use re-exports instead of TypeAliases in several places #7634
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
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
from typing_extensions import TypeAlias | ||
|
||
from urllib3 import _collections | ||
from urllib3._collections import RecentlyUsedContainer |
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.
from urllib3._collections import RecentlyUsedContainer | |
from urllib3._collections import RecentlyUsedContainer as RecentlyUsedContainer |
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.
I did that initially, but stubtest called me out. Turns out that it doesn't actually exist at runtime, we just use it for annotations in the stub. Not sure why stubtest didn't flag it before now.
Source: https://github.com/psf/requests/blob/main/requests/sessions.py
Stubtest: https://github.com/python/typeshed/runs/6046468647?check_suite_focus=true
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.
Oh interesting. stubtest's checking of type aliases is a little loose, see https://github.com/python/mypy/blob/ce858a6a0c85206ff877faf702293a9b67fae750/mypy/stubtest.py#L960 (I don't quite remember why I did it this way, maybe worth reinvestigating)
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Fixes #7632