-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add __all__
for asyncio.unix_events
& asyncio.taskgroups
, and simplify asyncio.__init__
#7343
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
asyncio.__init__
__all__
for aysncio.unix_events
& asyncio.taskgroups
, & simplify asyncio.__init__
__all__
for aysncio.unix_events
& asyncio.taskgroups
, & simplify asyncio.__init__
__all__
for aysncio.unix_events
& asyncio.taskgroups
, and simplify asyncio.__init__
@rchen152, any idea what the pytype error is trying to tell me? 🙂 |
This comment has been minimized.
This comment has been minimized.
__all__
for aysncio.unix_events
& asyncio.taskgroups
, and simplify asyncio.__init__
__all__
for asyncio.unix_events
& asyncio.taskgroups
, and simplify asyncio.__init__
Looks like pytype is either not allowing |
Thank you!! |
* __all__ should always be skipped. * Underscore-prefixed TypeVar definitions are obviously not meant to be exported. See python/typeshed#7343. PiperOrigin-RevId: 430327362
I've submitted a fix for this; as long as I don't run into any unexpected problems, I should be able to cut a pytype release containing the fix tomorrow or Thursday. |
Alright, pytype-2022.2.23 is out. Let me know if you run into any problems. |
Unblocks python#7343
Looks like it's working great — thanks for the quick fix! |
Diff from mypy_primer, showing the effect of this PR on open source code: core (https://github.com/home-assistant/core)
+ homeassistant/runner.py:51: error: Unused "type: ignore[misc, valid-type]" comment
+ homeassistant/runner.py:62: error: "HassEventLoopPolicy" has no attribute "_loop_factory" [attr-defined]
|
Ping on this -- the CI is green now that the pytype version used in CI has been updated :) |
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.
While I'm a tad worried about the second line in the primer output, this can be sorted out later if necessary.
Now that all
asyncio
submodules have accurate__all__
s, we can drastically simplify the imports inasyncio.__init__.pyi
and do something much more similar to what's done at runtime.