Use re-exports instead of TypeAliases in several places#7634
Use re-exports instead of TypeAliases in several places#7634hauntsaninja merged 6 commits intomasterfrom
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.
| from urllib3._collections import RecentlyUsedContainer | |
| from urllib3._collections import RecentlyUsedContainer as RecentlyUsedContainer |
There was a problem hiding this comment.
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.
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