FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

`asyncio.staggered` has incorrect type hints · Issue #114281 · python/cpython · GitHub

/ cpython Public

asyncio.staggered has incorrect type hints #114281

Description

Bug report

Correct ones: https://github.com/python/typeshed/blob/8885cc870cc1089cba30a6ac6d4ea1e32c83cedb/stdlib/asyncio/staggered.pyi

There are several major problems:

  1. loop: events.AbstractEventLoop = None, relies on very old mypy behaviour
  2. coro_fns: typing.Iterable[typing.Callable[[], typing.Awaitable]] does not have type var for Awaitable, which is very hard to read: reader has to infer this type variable themself

This is a problem if people are using runtime type-checkers that will use __annotations__ from this function and not typeshed definitions.

Basically, we don't use annotations in the stdlib, but when we do: it should be correct.

I propose fixing it and even upgrading some other stuff:

  1. It is a simple quality of life improvement
  2. It only uses simple types
  3. All python versions for backports are supported
  4. It should not be edited again in the recent future

Linked PRs

Metadata

Metadata

Assignees

Labels

stdlibStandard Library Python modules in the Lib/ directorytopic-asynciotopic-typingtype-bugAn unexpected behavior, bug, or error

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


Back | FazBrowse Home | New Git URL