File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,11 +35,9 @@ Here is a very simple generic class that represents a stack:
3535
3636 .. note ::
3737
38- The type parameter syntax (e.g., ``class Foo[T]: ``) is available in Python 3.12 and newer.
39- For earlier Python versions, generic classes need to be defined using
40- ``TypeVar `` and ``Generic ``, as shown below.
41-
42- For compatibility with older Python versions, the same class may be written as:
38+ The type parameter syntax (for example, ``class Foo[T]: ``) is available in
39+ Python 3.12 and newer. For earlier Python versions, use the legacy
40+ ``TypeVar `` and ``Generic `` syntax shown below.
4341
4442.. code-block :: python
4543
@@ -183,7 +181,7 @@ functions do not share any typing relationship to each other:
183181 return seq[- 1 ]
184182
185183 Variables should not have a type parameter in their type unless the type parameter
186- is bound by a containing generic class, generic function or generic alias.
184+ is bound by a containing generic class, generic function, or generic alias.
187185
188186.. _generic-methods-and-generic-self :
189187
You can’t perform that action at this time.
0 commit comments