Skip to content

Fix generic default documentation#2265

Open
George-Ogden wants to merge 1 commit intopython:mainfrom
George-Ogden:patch-1
Open

Fix generic default documentation#2265
George-Ogden wants to merge 1 commit intopython:mainfrom
George-Ogden:patch-1

Conversation

@George-Ogden
Copy link
Copy Markdown

Change the version defaults were added from Python 3.12 to Python 3.13

Pep 0695: https://peps.python.org/pep-0695/ says that the Python version is 3.12; however, it says in the docs that this was added in Python 3.13 (at the bottom of this section https://docs.python.org/3/library/typing.html#typing.TypeVar), and I'm getting a syntax error when I test this in Python 3.12.

Change the version defaults were added from Python 3.12 to Python 3.13
@srittau srittau added the topic: typing spec For improving the typing spec label Apr 19, 2026
Comment thread docs/spec/generics.rst
) # All valid

With the new Python 3.12 syntax for generics (introduced by :pep:`695`), this can
With the new Python 3.13 syntax for generics (introduced by :pep:`695`), this can
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Type variable defaults were in fact introduced by PEP 696, not PEP 695, which is likely the reason why the Python version was also inaccurate here previously

Suggested change
With the new Python 3.13 syntax for generics (introduced by :pep:`695`), this can
With the new Python 3.13 syntax for generics (introduced by :pep:`696`), this can

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: typing spec For improving the typing spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants