Skip to content
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

Make types classes that are generic at type time subscriptable at runtime #110209

Closed
Gobot1234 opened this issue Oct 2, 2023 · 0 comments
Closed
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-typing type-feature A feature request or enhancement

Comments

@Gobot1234
Copy link
Contributor

Gobot1234 commented Oct 2, 2023

Feature or enhancement

Proposal:

coroutine and generator should be subscriptable at runtime as they already are at type time

>>> import types
>>> types.CoroutineType[None, None, int]
TypeError: type 'coroutine' is not subscriptable

https://github.com/python/typeshed/blob/31916d1e0c4c213cac031e2a448e5531206e3ab4/stdlib/types.pyi#L402

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

python/typing#1480 is where this stemmed from

Linked PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-typing type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants