8000 Fix old behaviour in typing documentation by Gobot1234 · Pull Request #103400 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
< 8000 /div>

Fix old behaviour in typing documentation #103400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8000
Merged
merged 1 commit into from
Apr 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
0