https://github.com/python/cpython/commit/7dd784e701132d1871bf02e47db44ab3ff2fbd6c commit: 7dd784e701132d1871bf02e47db44ab3ff2fbd6c branch: 3.13 author: Miss Islington (bot) <[email protected]> committer: JelleZijlstra <[email protected]> date: 2026-04-22T19:57:40-07:00 summary:
[3.13] gh-142965: Fix Concatenate documentation to reflect valid use cases (GH-143316) (#148900) The documentation previously stated that Concatenate is only valid when used as the first argument to Callable, but according to PEP 612, it can also be used when instantiating user-defined generic classes with ParamSpec parameters. (cherry picked from commit 75ff1afcb6a1bb2b3d54899e9b222a61798fa491) Co-authored-by: John Seong <[email protected]> files: M Doc/library/typing.rst diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 250c861f872c96..8569e2e4491f00 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -1166,7 +1166,8 @@ These can be used as types in annotations. They all support subscription using or transforms parameters of another callable. Usage is in the form ``Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable]``. ``Concatenate`` - is currently only valid when used as the first argument to a :ref:`Callable <annotating-callables>`. + is valid when used in :ref:`Callable <annotating-callables>` type hints + and when instantiating user-defined generic classes with :class:`ParamSpec` parameters. The last parameter to ``Concatenate`` must be a :class:`ParamSpec` or ellipsis (``...``). _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
