GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `asyncio.staggered` has incorrect type hints · Issue #114281 · python/cpython

asyncio.staggered has incorrect type hints #114281

New issue
Copy link
New issue
Copy link
Closed
Closed
asyncio.staggered has incorrect type hints#114281
Copy link
Assignees
sobolevn
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-asynciotopic-typingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@sobolevn
sobolevn
opened on Jan 19, 2024
Issue body actions

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

  • gh-114281: Remove incorrect type hints from asyncio.staggered #114282

Activity

  1. sobolevn
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    topic-asyncio
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    topic-typing
    on Jan 19, 2024
  2. sobolevn
    self-assigned this
    on Jan 19, 2024
  3. github-project-automation
    added this to asyncioon Jan 19, 2024
  4. github-project-automation
    moved this to Todo in asyncioon Jan 19, 2024
  5. sobolevn
    added 2 commits that reference this issue on Jan 19, 2024

    pythongh-114281: Improve type hints in `asyncio/stagged.py`

    4b387c4

    pythongh-114281: Improve type hints in `asyncio/staggered.py`

    7206e41
  6. AA-Turner
    added a commit that references this issue on Jan 20, 2024

    gh-114281: Remove incorrect type hints from `asyncio.staggered` (#114282

    0554a95
  7. AA-Turner
    closed this as completedon Jan 20, 2024
  8. github-project-automation
    moved this from Todo to Done in asyncioon Jan 20, 2024
  9. AA-Turner commented on Jan 20, 2024

    @AA-Turner
    AA-Turner
    on Jan 20, 2024
    Member
    More actions

    Thanks @sobolevn!

    A

  10. kulikjak
    added a commit that references this issue on Jan 22, 2024

    pythongh-114281: Remove incorrect type hints from `asyncio.staggered` (…

    5195dc2
  11. aisk
    added a commit that references this issue on Feb 11, 2024

    pythongh-114281: Remove incorrect type hints from `asyncio.staggered` (…

    f4dbfb7
  12. Glyphack
    added a commit that references this issue on Sep 2, 2024

    pythongh-114281: Remove incorrect type hints from `asyncio.staggered` (…

    d0754cf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @sobolevn
    sobolevn

Labels

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

Projects

  • asyncio
    Status
    Done
    Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.