aboutsummaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>2021-01-02 08:45:50 +0800
committerGitHub <noreply@github.com>2021-01-01 16:45:50 -0800
commit11276cd9c49faea66ce7760f26a238d1edbf6421 (patch)
treebcd8d1ad381e420e1977fc3d9c93dbb4f70c4819 /Lib
parentbpo-42756: Configure LMTP Unix-domain socket to use global default timeout wh... (diff)
downloadcpython-11276cd9c49faea66ce7760f26a238d1edbf6421.tar.gz
cpython-11276cd9c49faea66ce7760f26a238d1edbf6421.tar.bz2
cpython-11276cd9c49faea66ce7760f26a238d1edbf6421.zip
bpo-41559: Documentation for PEP 612 (GH-24000)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/typing.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/Lib/typing.py b/Lib/typing.py
index b140b0e6696..88d0d623a42 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -544,8 +544,9 @@ def TypeAlias(self, parameters):
@_SpecialForm
def Concatenate(self, parameters):
- """Used in conjunction with ParamSpec and Callable to represent a higher
- order function which adds, removes or transforms parameters of a Callable.
+ """Used in conjunction with ``ParamSpec`` and ``Callable`` to represent a
+ higher order function which adds, removes or transforms parameters of a
+ callable.
For example::
@@ -735,11 +736,11 @@ class ParamSpec(_Final, _Immutable, _TypeVarLike, _root=True):
Parameter specification variables exist primarily for the benefit of static
type checkers. They are used to forward the parameter types of one
- Callable to another Callable, a pattern commonly found in higher order
- functions and decorators. They are only valid when used in Concatenate, or
- as the first argument to Callable, or as parameters for user-defined Generics.
- See class Generic for more information on generic types. An example for
- annotating a decorator::
+ callable to another callable, a pattern commonly found in higher order
+ functions and decorators. They are only valid when used in ``Concatenate``,
+ or s the first argument to ``Callable``, or as parameters for user-defined
+ Generics. See class Generic for more information on generic types. An
+ example for annotating a decorator::
T = TypeVar('T')
P = ParamSpec('P')