diff --git a/pep-0673.rst b/pep-0673.rst index 5153d938ef3..6fb4a88f4bd 100644 --- a/pep-0673.rst +++ b/pep-0673.rst @@ -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: @@ -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: @@ -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