close
Skip to content

Runtime changes for PEP 718 -- generic function subscription - #156201

Draft
gvanrossum wants to merge 1 commit into
python:mainfrom
gvanrossum:pep718
Draft

Runtime changes for PEP 718 -- generic function subscription#156201
gvanrossum wants to merge 1 commit into
python:mainfrom
gvanrossum:pep718

Conversation

@gvanrossum

@gvanrossum gvanrossum commented Aug 21, 2026

Copy link
Copy Markdown
Member

This is a vibe-coded port to main (3.16) of @Gobot1234's original 3.13 patch. I haven't reviewed it closely, but it seems to work. One of us will do the work when the PEP is accepted.

Note that at runtime, function subscription acts more like generic builtins (e.g. list[str]) than like classes. Type checkers will be the ultimate arbiter.

Triagers: if this needs an issue, let me know and I'll gladly add it.

Comment on lines -52 to +55
from types import GenericAlias, MappingProxyType, AsyncGeneratorType, CoroutineType, GeneratorType
from types import (
AsyncGeneratorType, CoroutineType, GeneratorType, GenericAlias,
MappingProxyType,
)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This seems redundant (it's just reformatting an import without adding or removing anything).

@gvanrossum gvanrossum changed the title Runtime changes for PEP 718 9 Runtime changes for PEP 718 -- generic function subscription Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant