-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Support PEP 695 syntax for class definitions #11438
Copy link
Copy link
Closed
Description
PEP 695, which is implemented in the upcoming Python 3.12, adds a new syntax for defining generic classes:
class Sequence[T]:
def __getitem__(self, idx: int) -> T: ...I would like to document generic classes with e.g. .. class:: Sequence[T], but that doesn't render correctly (the class introduction doesn't appear):
Presumably the parser for the class directive needs to be taught to recognize this syntax. (Cross-ref: python/cpython#104642 (comment).)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels