PEP 612: Clean up code examples, link to CPython implementation (#1745)

This commit is contained in:
kj 2020-12-24 12:20:36 +08:00 committed by GitHub
parent 831e7256d5
commit 08f7e0e699
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -216,7 +216,6 @@ inheriting from ``Generic[P]`` makes a class generic on
.. code-block:: .. code-block::
T = TypeVar("T") T = TypeVar("T")
S = TypeVar("S")
P_2 = ParamSpec("P_2") P_2 = ParamSpec("P_2")
class X(Generic[T, P]): class X(Generic[T, P]):
@ -300,7 +299,7 @@ evaluated in the same way.
.. code-block:: .. code-block::
U = TypeVar("T") U = TypeVar("U")
class Y(Generic[U, P]): class Y(Generic[U, P]):
f: Callable[P, str] f: Callable[P, str]
@ -577,7 +576,9 @@ Reference Implementation
The `Pyre <https://pyre-check.org/>`_ type checker supports all of the behavior The `Pyre <https://pyre-check.org/>`_ type checker supports all of the behavior
described above. A reference implementation of the runtime components needed described above. A reference implementation of the runtime components needed
for those uses is provided in the ``pyre_extensions`` module. for those uses is provided in the ``pyre_extensions`` module. A reference
implementation for CPython can be found
`here <https://github.com/python/cpython/pull/23702>`_.
Rejected Alternatives Rejected Alternatives
--------------------- ---------------------