Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

asyncio.staggered has incorrect type hints #114281

Closed
Assignees
sobolevn
Labels
stdlibStandard Library Python modules in the Lib/ directorytopic-asynciotopic-typingtype-bugAn unexpected behavior, bug, or error
@sobolevn

Description

@sobolevn

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 forAwaitable, 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


    [8]ページ先頭

    ©2009-2025 Movatter.jp