PEP 612: Clean up code examples, link to CPython implementation (#1745)
This commit is contained in:
parent
831e7256d5
commit
08f7e0e699
|
@ -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
|
||||||
---------------------
|
---------------------
|
||||||
|
|
Loading…
Reference in New Issue