Skip to content

Commit a72be6a

Browse files
authored
PEP-718: Indicate that the (lenient) mypy patch is up-to-date (#5195)
* Indicate that the (lenient) mypy patch is up-to-date * Link directly to PRs in note about experimental status
1 parent 06b1b26 commit a72be6a

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

‎peps/pep-0718.rst‎

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -839,22 +839,21 @@ Reference Implementation
839839
branch. It predates ``types.FunctionGenericAlias`` (it returns a plain
840840
``types.GenericAlias``) and does not yet cover ``MethodWrapperType``.
841841
* `python/mypy#21880 <https://github.com/python/mypy/pull/21880>`__: a type checker
842-
prototype of the behaviour specified here, behind
843-
``--enable-incomplete-feature=SubscriptableFunctions``. It confirmed that
844-
``ParamSpec``, ``TypeVarTuple`` and type parameter defaults can follow the rules for
845-
generic classes by reusing the same code, and implements the overload filtering
846-
described above.
842+
prototype behind ``--enable-incomplete-feature=SubscriptableFunctions``.
843+
It implements function subscription, including overload filtering, method
844+
binding, type parameter defaults, ``ParamSpec`` and ``TypeVarTuple`` support,
845+
and the Python 3.16 version check.
847846
* `python/mypy#21881 <https://github.com/python/mypy/pull/21881>`__: a variant of the
848847
prototype that only allows subscripting callables traceable to a ``def`` (see
849848
`Rejected Ideas`_). It cannot be fully sound either, since type checkers have to
850849
assume that decorators preserve the kind of object they wrap.
851850

852-
The following rules are not yet implemented in either prototype: reporting unsolvable
853-
type parameters at the call instead of the definition, not reporting overloads that
854-
differ only in type parameter bounds as overlapping, the consistency rule for overload
855-
implementations, the Python version check, and keeping return-only type parameters
856-
through ``ParamSpec`` decorators (mypy currently solves them to ``Never``, so a
857-
``contextmanager`` function like ``session`` above cannot be subscripted).
851+
The prototypes are experimental. The mypy prototype in
852+
`python/mypy#21880 <https://github.com/python/mypy/pull/21880>`__
853+
has been updated to address the typing rules specified here, with regression
854+
tests. The stricter variant in
855+
`python/mypy#21881 <https://github.com/python/mypy/pull/21881>`__
856+
has not received these updates. The cpython prototype has not yet been updated.
858857

859858
Rejected Ideas
860859
--------------

0 commit comments

Comments
 (0)