Skip to content

Commit 1e78f7e

Browse files
committed
gh-142965: Fix Concatenate documentation to reflect valid use cases
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.
1 parent daa9aa4 commit 1e78f7e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Doc/library/typing.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,8 @@ These can be used as types in annotations. They all support subscription using
11741174
or transforms parameters of another
11751175
callable. Usage is in the form
11761176
``Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable]``. ``Concatenate``
1177-
is currently only valid when used as the first argument to a :ref:`Callable <annotating-callables>`.
1177+
is valid when used in :ref:`Callable <annotating-callables>` type hints
1178+
and when instantiating user-defined generic classes with :class:`ParamSpec` parameters.
11781179
The last parameter to ``Concatenate`` must be a :class:`ParamSpec` or
11791180
ellipsis (``...``).
11801181

0 commit comments

Comments
 (0)