Content-Length: 270960 | pFad | https://github.com/python/cpython/issues/110209

42 Make types classes that are generic at type time subscriptable at runtime · Issue #110209 · python/cpython · GitHub
Skip to content

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

@Gobot1234

Description

@Gobot1234

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/110209

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy