Skip to content

Commit a45ec7a

Browse files
authored
Merge branch 'main' into update-generics-pep695
2 parents 863fbf7 + 9cd0a22 commit a45ec7a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

docs/guides/libraries.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ Overloads
353353

354354
If a function or method can return multiple different types and those
355355
types can be determined based on the presence or types of certain
356-
parameters, use the ``@overload`` mechanism defined in `PEP
357-
484 <https://www.python.org/dev/peps/pep-0484/#id45>`__. When overloads
356+
parameters, use the ``@overload`` mechanism described in the
357+
:py:data:`typing.overload` documentation. When overloads
358358
are used within a “.py” file, they must appear prior to the function
359359
implementation, which should not have an ``@overload`` decorator.
360360

@@ -471,8 +471,8 @@ Generic Classes and Functions
471471
-----------------------------
472472

473473
Classes and functions that can operate in a generic manner on various
474-
types should declare themselves as generic using the mechanisms
475-
described in :pep:`484`.
474+
types should declare themselves as generic using standard typing
475+
mechanisms such as ``TypeVar``.
476476
This includes the use of ``TypeVar`` symbols. Typically, a ``TypeVar``
477477
should be private to the file that declares it, and should therefore
478478
begin with an underscore.
@@ -499,7 +499,7 @@ annotation.
499499
# Recursive type alias
500500
TreeNode = LeafNode | list["TreeNode"]
501501
502-
# Explicit type alias using PEP 613 syntax
502+
# Explicit type alias using TypeAlias
503503
StrOrInt: TypeAlias = str | int
504504
505505
Abstract Classes and Methods

0 commit comments

Comments
 (0)