]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix old behaviour in typing documentation (#103400)
authorJames Hilton-Balfe <gobot1234yt@gmail.com>
Sun, 9 Apr 2023 21:55:32 +0000 (22:55 +0100)
committerGitHub <noreply@github.com>
Sun, 9 Apr 2023 21:55:32 +0000 (22:55 +0100)
Doc/library/typing.rst

index 03ff259bbdf75f87ca2b0bc69d40204a29ddc367..15bab7775eadd88d5d9220982c211b53d48fbecd 100644 (file)
@@ -423,7 +423,7 @@ to this is that a list of types can be used to substitute a :class:`ParamSpec`::
    >>> class Z(Generic[T, P]): ...
    ...
    >>> Z[int, [dict, float]]
-   __main__.Z[int, (<class 'dict'>, <class 'float'>)]
+   __main__.Z[int, [dict, float]]
 
 
 Furthermore, a generic with only one parameter specification variable will accept
@@ -434,9 +434,9 @@ to the former, so the following are equivalent::
    >>> class X(Generic[P]): ...
    ...
    >>> X[int, str]
-   __main__.X[(<class 'int'>, <class 'str'>)]
+   __main__.X[[int, str]]
    >>> X[[int, str]]
-   __main__.X[(<class 'int'>, <class 'str'>)]
+   __main__.X[[int, str]]
 
 Do note that generics with :class:`ParamSpec` may not have correct
 ``__parameters__`` after substitution in some cases because they