Skip to content

Use general type ignore for asyncio.Task #8861

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

Merged
merged 1 commit into from
Oct 7, 2022

Conversation

cdce8p
Copy link
Contributor

@cdce8p cdce8p commented Oct 7, 2022

Discovered while working on python/mypy#13831

Mypy does also complain about the covariance introduced in #8781.
To reproduce a simple test case from mypy

# test.py

from asyncio import Future, wait
from typing import List

async def foo() -> None:
    f = []  # type: List[Future[None]]
    await wait(f)
mypy --no-silence-site-packages test.py
mypy/typeshed/stdlib/asyncio/tasks.pyi:273: error: Variance of TypeVar "_T_co" incompatible with variance in parent type  [type-var]

/CC: @hauntsaninja

@JelleZijlstra
Copy link
Member

I think we just merged the mypy change that checks for this.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think this is because mypy complains about this on the master branch, but not in the release of mypy we use in CI (the check was only recently added)

@cdce8p
Copy link
Contributor Author

cdce8p commented Oct 7, 2022

Found it: python/mypy#13714

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2022

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood AlexWaygood merged commit 93075bf into python:master Oct 7, 2022
@cdce8p cdce8p deleted the fix-type-ignore branch October 7, 2022 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants