summaryrefslogtreecommitdiffstats
path: root/Lib/typing.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-06-07 15:04:14 (GMT)
committerGitHub <noreply@github.com>2023-06-07 15:04:14 (GMT)
commit9a7c4a5f39ec795f1ea77e1dfc557514f8f8a04a (patch)
tree5c1cb6820fa900cbf89513382babffe3685cd769 /Lib/typing.py
parentd36aa244c860f96564c6a94d568bfb7f6a0251bf (diff)
downloadcpython-9a7c4a5f39ec795f1ea77e1dfc557514f8f8a04a.zip
cpython-9a7c4a5f39ec795f1ea77e1dfc557514f8f8a04a.tar.gz
cpython-9a7c4a5f39ec795f1ea77e1dfc557514f8f8a04a.tar.bz2
[3.12] typing: Improve documentation of generic classes and aliases (GH-105369) (#105453)
typing: Improve documentation of generic classes and aliases (GH-105369) (cherry picked from commit d63a7c3694d5c4484fcaa01c33590b1d4bc2559e) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Diffstat (limited to 'Lib/typing.py')
-rw-r--r--Lib/typing.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/typing.py b/Lib/typing.py
index 0983f20..0ff29fa 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -2549,11 +2549,13 @@ Callable = _CallableType(collections.abc.Callable, 2)
Callable.__doc__ = \
"""Deprecated alias to collections.abc.Callable.
- Callable[[int], str] signifies a function of (int) -> str.
+ Callable[[int], str] signifies a function that takes a single
+ parameter of type int and returns a str.
+
The subscription syntax must always be used with exactly two
values: the argument list and the return type.
- The argument list must be a list of types, a ParamSpec or ellipsis.
- The return type must be a single type.
+ The argument list must be a list of types, a ParamSpec,
+ Concatenate or ellipsis. The return type must be a single type.
There is no syntax to indicate optional or keyword arguments;
such function types are rarely used as callback types.