Skip to content

Update generics reference to use PEP 695 type parameter syntax#2242

Open
BHUVANSH855 wants to merge 1 commit intopython:mainfrom
BHUVANSH855:update-generics-pep695
Open

Update generics reference to use PEP 695 type parameter syntax#2242
BHUVANSH855 wants to merge 1 commit intopython:mainfrom
BHUVANSH855:update-generics-pep695

Conversation

@BHUVANSH855
Copy link
Copy Markdown

This PR updates the reference/generics.rst documentation to reflect the modern type parameter syntax introduced in PEP 695.

Changes include:

  • Updating initial examples (e.g., Stack, Box) to use class Foo[T] syntax
  • Adding a note explaining the transition from TypeVar/Generic to PEP 695
  • Retaining mention of older syntax for backward compatibility

This improves consistency with the spec documentation and reduces confusion for users of Python 3.12+.

Fixes #2227

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update reference/generics.html with PEP695 type parameter syntax

1 participant