Skip to content

no error when subscripting AbstractContextManager when targeting python 3.8 #16097

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

Open
DetachHead opened this issue Sep 13, 2023 · 1 comment
Labels
bug mypy got something wrong topic-pep-585 PEP 585 (builtin generics)

Comments

@DetachHead
Copy link
Contributor

from contextlib import AbstractContextManager

foo = AbstractContextManager[int] # runtime error, no mypy error

playground

@DetachHead DetachHead added the bug mypy got something wrong label Sep 13, 2023
@KotlinIsland
Copy link
Contributor

The easiest way to handle this situation would be to special case it.

@AlexWaygood AlexWaygood added the topic-pep-585 PEP 585 (builtin generics) label Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-pep-585 PEP 585 (builtin generics)
Projects
None yet
Development

No branches or pull requests

3 participants