Uh oh!
There was an error while loading. Please reload this page.
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__AlexWaygood
commented
Feb 21, 2022
@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__rchen152
commented
Feb 22, 2022
Looks like pytype is either not allowing |
AlexWaygood
commented
Feb 22, 2022
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
rchen152
commented
Feb 23, 2022
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. |
rchen152
commented
Feb 24, 2022
Alright, pytype-2022.2.23 is out. Let me know if you run into any problems. |
AlexWaygood
commented
Feb 24, 2022
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] |
AlexWaygood
commented
Feb 28, 2022
Ping on this -- the CI is green now that the pytype version used in CI has been updated :) |
srittau
left a comment
There was a problem hiding this comment.
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
asynciosubmodules have accurate__all__s, we can drastically simplify the imports inasyncio.__init__.pyiand do something much more similar to what's done at runtime.