Skip to content
Prev Previous commit
Next Next commit
Improve links to typing docs
  • Loading branch information
AlexWaygood committed Nov 4, 2021
commit 7ae4fac3de3d68a1a5c2c3f911290b595993e8ab
1 change: 1 addition & 0 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ called :class:`TypeVar`.
def first(l: Sequence[T]) -> T: # Generic function
return l[0]

.. _user-defined-generics:

User-defined generic types
==========================
Expand Down
6 changes: 3 additions & 3 deletions Doc/reference/datamodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2228,9 +2228,9 @@ For example, the annotation ``list[int]`` might be used to signify a
:ref:`Generic Alias Types<types-genericalias>`
Documentation for objects representing parameterized generic classes

:class:`typing.Generic`
Inherit from :class:`typing.Generic` to implement generic classes that
can be parameterized at runtime and understood by static type-checkers.
:ref:`Generics`, :ref:`user-defined generics<user-defined-generics>` and :class:`typing.Generic`
Documentation on how to implement generic classes that can be
parameterized at runtime and understood by static type-checkers.

A class can generally only be parameterized if it defines the special
classmethod ``__class_getitem__()``.
Expand Down