Skip to content

Commit f3c8644

Browse files
author
Daniel Sperber
committed
Move Unpack[TD] -> ParamSpec substitution into Open Questions
1 parent 1786baa commit f3c8644

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

peps/pep-0821.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,6 @@ and ``**kwargs``, which conflicts with ``Unpack[TD]``::
191191

192192
Callable[[P, Unpack[KeywordTD]], R] # Not allowed
193193

194-
When specializing a generic type parameterized by a ``ParamSpec``, an
195-
unpacked ``TypedDict`` can be used as a type argument.
196-
This applies regardless of whether a ``Callable`` special form is
197-
involved::
198-
199-
type CallableP[**P] = Callable[P, Any]
200-
201-
h: CallableP[Unpack[KeywordTD]] = normal # Accepted
202-
h2: CallableP[Unpack[KeywordTD]] = kw_only # Accepted
203-
h3: CallableP[Unpack[KeywordTD]] = pos_only # Rejected
204-
205194
Backwards Compatibility
206195
=======================
207196

@@ -297,6 +286,17 @@ Rejected Ideas
297286
Open Questions
298287
==============
299288

289+
* Should this PEP explicitly allow a ``ParamSpec`` to be substituted by an
290+
unpacked ``TypedDict`` in generic type arguments, independent of
291+
``Callable``? This would broaden the scope beyond ``Callable`` and would
292+
apply to any generic parameterized by a ``ParamSpec``. For example::
293+
294+
type CallableP[**P] = Callable[P, Any]
295+
296+
h: CallableP[Unpack[KeywordTD]] = normal # Accepted
297+
h2: CallableP[Unpack[KeywordTD]] = kw_only # Accepted
298+
h3: CallableP[Unpack[KeywordTD]] = pos_only # Rejected
299+
300300
* Should ``Unpack`` of a generic ``TypedDict`` be permitted inside
301301
``Callable``? For example::
302302

0 commit comments

Comments
 (0)