diff --git a/pep-0612.rst b/pep-0612.rst index 0198d9639..466630e62 100644 --- a/pep-0612.rst +++ b/pep-0612.rst @@ -228,7 +228,7 @@ inheriting from ``Generic[P]`` makes a class generic on def f(x: X[int, ...]) -> str: ... # Accepted def f(x: X[int, int]) -> str: ... # Rejected -By the rules defined above, spelling an concrete instance of a class generic +By the rules defined above, spelling a concrete instance of a class generic with respect to only a single ``ParamSpec`` would require unsightly double brackets. For aesthetic purposes we allow these to be omitted. @@ -447,7 +447,7 @@ To extend this to include ``Concatenate``, we declare the following properties: * A function declared as ``def inner(a: A, b: B, *args: P.args, **kwargs: P.kwargs) -> R`` has type ``Callable[Concatenate[A, B, P], R]``. Placing keyword-only - parameters beterrn the ``*args`` and ``**kwargs`` is forbidden. + parameters between the ``*args`` and ``**kwargs`` is forbidden. .. code-block:: @@ -462,7 +462,7 @@ To extend this to include ``Concatenate``, we declare the following properties: return foo # Accepted - def remove(x: Callable[Concatenate[int, P], int]) -> Callable[P, None]: + def remove(f: Callable[Concatenate[int, P], int]) -> Callable[P, None]: def foo(*args: P.args, **kwargs: P.kwargs) -> None: f(1, *args, **kwargs) # Accepted @@ -566,7 +566,7 @@ so: .. code-block:: R = typing.TypeVar(“R”) - Tpositionals = .... + Tpositionals = ... Tkeywords = ... class BetterCallable(typing.Protocol[Tpositionals, Tkeywords, R]): def __call__(*args: Tpositionals, **kwargs: Tkeywords) -> R: ...