diff options
author | Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> | 2021-01-02 00:45:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-02 00:45:50 (GMT) |
commit | 11276cd9c49faea66ce7760f26a238d1edbf6421 (patch) | |
tree | bcd8d1ad381e420e1977fc3d9c93dbb4f70c4819 /Lib | |
parent | 3bf05327c2b25d42b92795d9d280288c22a0963d (diff) | |
download | cpython-11276cd9c49faea66ce7760f26a238d1edbf6421.zip cpython-11276cd9c49faea66ce7760f26a238d1edbf6421.tar.gz cpython-11276cd9c49faea66ce7760f26a238d1edbf6421.tar.bz2 |
bpo-41559: Documentation for PEP 612 (GH-24000)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/typing.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Lib/typing.py b/Lib/typing.py index b140b0e..88d0d62 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') |