@@ -289,7 +289,8 @@ The following directives are provided for module and class contents:
289289 .. py:exception:: name[type parmeters](parameters)
290290
291291 Describes an exception class. The signature can, but need not include
292- parentheses with constructor arguments.
292+ parentheses with constructor arguments, or may optionally include type
293+ parameters (see :pep: `695 `).
293294
294295 .. rubric :: options
295296
@@ -379,9 +380,9 @@ The following directives are provided for module and class contents:
379380 .. rst:directive:option:: single-line-type-parameter-list
380381 :type: no value
381382
382- Ensure that the class constructor's type parameters are emitted on a
383- single logical line, overriding :confval:`python_maximum_signature_line_length`
384- and :confval:`maximum_signature_line_length`.
383+ Ensure that the class type parameters are emitted on a single logical
384+ line, overriding :confval:`python_maximum_signature_line_length` and
385+ :confval:`maximum_signature_line_length`.
385386
386387 .. rst :directive :: .. py:attribute:: name
387388
@@ -620,7 +621,19 @@ argument support), you can use brackets to specify the optional parts:
620621It is customary to put the opening bracket before the comma.
621622
622623Since Python 3.12, it is possible to indicate type parameters directly at the
623- function or class definition site::
624+ function or class definition site:
625+
626+ .. code-block :: python
627+
628+ class MyDict[T](dict[str , T]):
629+ ...
630+
631+ def add[T](x: T, y: T) -> T:
632+ return x + y
633+
634+ The corresponding documentation would look like::
635+
636+ .. py:class:: MyDict[T]
624637
625638 .. py:function:: add[T](x: T, y: T) -> T
626639
0 commit comments