Skip to content

Commit dc885f4

Browse files
committed
Get rid of all the the QUESTION things, put them in open issues.
1 parent 3d40b83 commit dc885f4

1 file changed

Lines changed: 38 additions & 33 deletions

File tree

pep.rst

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,8 @@ We have two subproposals that are necessary to get mileage out of the
292292
main part of this proposal.
293293

294294

295+
.. _unpack-kwargs:
296+
295297
Unpack of typevars for ``**kwargs``
296298
-----------------------------------
297299

@@ -328,11 +330,7 @@ from "PEP 646 – Variadic Generics".
328330
When inferring types here, the type checker should **infer literal
329331
types when possible**. This means inferring literal types for
330332
arguments that **do not** appear in the bound, as well as
331-
for arguments that **do** appear in the bound as read-only (QUESTION: Or
332-
maybe we should make whether to do it for extra arguments
333-
configurable in the ``TypedDict`` serving as the bound somehow? If
334-
``readonly`` had been added as a parameter to ``TypedDict`` we would
335-
use that.)
333+
for arguments that **do** appear in the bound as read-only.
336334

337335
For each non-required item in the bound that does **not** have a
338336
matching argument provided, then if the item is read-only, it will
@@ -345,6 +343,8 @@ This is potentially moderately useful on its own but is being done to
345343
support processing ``**kwargs`` with type level computation.
346344

347345

346+
.. _extended-callables-prereq:
347+
348348
Extended Callables
349349
------------------
350350

@@ -416,11 +416,6 @@ or, using the type abbreviations we provide::
416416

417417
(Rationale discussed :ref:`below <callable-rationale>`.)
418418

419-
QUESTION: Should the extended argument list be wrapped in a
420-
``typing.Parameters[*Params]`` type (that will also kind of serve as a
421-
bound for ``ParamSpec``)?
422-
423-
424419
Specification
425420
=============
426421

@@ -744,10 +739,6 @@ the type argument of ``Member``, to disallow its use for
744739
locals, parameter types, return types, nested inside other types,
745740
etc. Rationale discussed :ref:`below <generic-callable-rationale>`.
746741

747-
QUESTION: Should we have any mechanisms to inspect/destruct
748-
``GenericCallable``. Maybe can fetch the variable information and
749-
maybe can apply it to concrete types?
750-
751742
Overloaded function types
752743
'''''''''''''''''''''''''
753744

@@ -764,6 +755,8 @@ Raise error
764755

765756
Any additional type arguments should be included in the message.
766757

758+
.. _update-class:
759+
767760
Update class
768761
''''''''''''
769762

@@ -780,16 +773,6 @@ Update class
780773
parameterized by ``type[T]``, then the class type should be
781774
substituted in for ``T``.
782775

783-
One snag here: it introduces type-evaluation-order dependence; if the
784-
``UpdateClass`` return type for some ``__init_subclass__`` inspects
785-
some unrelated class's ``Members``, and that class also has an
786-
``__init_subclass__``, then the results might depend on what order
787-
they are evaluated. Ideally this kind of case would be rejected,
788-
which I think ought to be possible?
789-
790-
This does actually exactly mirror a potential **runtime**
791-
evaluation-order dependence, though.
792-
793776
.. _lifting:
794777

795778
Lifting over Unions
@@ -1224,15 +1207,6 @@ I am proposing a fully new extended callable syntax because:
12241207
closely mimic the ``mypy_extensions`` version though, if something new
12251208
is a non-starter)
12261209

1227-
QUESTION: Currently I made the qualifiers be short strings, for code brevity
1228-
when using them, but an alternate approach would be to mirror
1229-
``inspect.Signature`` more directly, and have an enum with names like
1230-
``ParamKind.POSITIONAL_OR_KEYWORD``. Would that be better?
1231-
1232-
A related potential change would be to fully separate the kind from whether
1233-
there is a default, and have whether there is a default represented in
1234-
an ``init`` field, like we do for ``Member``.
1235-
12361210
.. _generic-callable-rationale:
12371211

12381212
Generic Callable
@@ -1783,6 +1757,37 @@ Open Issues
17831757

17841758
* What invalid operations should be errors and what should return ``Never``?
17851759

1760+
* :ref:`Unpack of typevars for **kwargs <unpack-kwargs>`: Should
1761+
whether we try to infer literal types for extra arguments be
1762+
configurable in the ``TypedDict`` serving as the bound somehow? If
1763+
``readonly`` had been added as a parameter to ``TypedDict`` we would
1764+
use that, but it wasn't.
1765+
1766+
* :ref:`Extended Callables <extended-callables-prereq>`: Should the extended
1767+
argument list be wrapped in a ``typing.Parameters[*Params]`` type (that
1768+
will also kind of serve as a bound for ``ParamSpec``)?
1769+
1770+
* :ref:`Extended Callables <extended-callables-prereq>`: Currently the
1771+
qualifiers are short strings for code brevity, but an alternate approach
1772+
would be to mirror ``inspect.Signature`` more directly, and have an enum
1773+
with names like ``ParamKind.POSITIONAL_OR_KEYWORD``. Would that be better?
1774+
1775+
A related potential change would be to fully separate the kind from whether
1776+
there is a default, and have whether there is a default represented in
1777+
an ``init`` field, like we do for class member initializers with ``Member``.
1778+
1779+
* :ref:`Generic Callable <generic-callable>`: Should we have any mechanisms
1780+
to inspect/destruct ``GenericCallable``? Maybe can fetch the variable
1781+
information and maybe can apply it to concrete types?
1782+
1783+
* :ref:`Update class <update-class>`: ``UpdateClass`` introduces
1784+
type-evaluation-order dependence; if the ``UpdateClass`` return type for
1785+
some ``__init_subclass__`` inspects some unrelated class's ``Members``,
1786+
and that class also has an ``__init_subclass__``, then the results might
1787+
depend on what order they are evaluated. Ideally this kind of case would be
1788+
rejected. This does actually exactly mirror a potential **runtime**
1789+
evaluation-order dependence, though.
1790+
17861791
What exactly are the subtyping (etc) rules for unevaluated types
17871792
----------------------------------------------------------------
17881793

0 commit comments

Comments
 (0)