Fix old behaviour in typing documentation (#103400)

This commit is contained in:
James Hilton-Balfe 2023-04-09 22:55:32 +01:00 committed by GitHub
parent 6d97e52116
commit ecad802e3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View 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