Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEP 673: Fix a couple of typos #2419

Merged
merged 2 commits into from
Mar 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pep-0673.rst
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ Use in Protocols

from typing import Protocol, Self

class Shape(Protocol):
class ShapeProtocol(Protocol):
scale: float

def set_scale(self, scale: float) -> Self:
Expand All @@ -494,7 +494,7 @@ is treated equivalently to:

SelfShape = TypeVar("SelfShape", bound="ShapeProtocol")

class Shape(Protocol):
class ShapeProtocol(Protocol):
scale: float

def set_scale(self: SelfShape, scale: float) -> SelfShape:
Expand Down Expand Up @@ -658,7 +658,7 @@ The following uses of ``Self`` are rejected.
class Bar(Generic[T]):
def bar(self) -> T: ...

class Baz(Foo[Self]): ... # Rejected
class Baz(Bar[Self]): ... # Rejected

We reject type aliases containing ``Self``. Supporting ``Self``
outside class definitions can require a lot of special-handling in
Expand Down