Skip to content
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
5 changes: 2 additions & 3 deletions pep-0673.rst
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ We propose using ``Self`` directly to achieve the same behavior:
class Shape:
def difference(self, other: Self) -> float: ...

def apply(self, f: Callable[[Self], None]) -> None:
def apply(self, f: Callable[[Self], None]) -> None: ...

Note that specifying ``self: Self`` is harmless, so some users may find it
more readable to write the above as:
Expand Down Expand Up @@ -350,9 +350,8 @@ We propose expressing this constraint using ``next: Self | None``:

@dataclass
class LinkedList(Generic[T]):
next: Self | None = None
value: T

next: Self | None = None

@dataclass
class OrdinalLinkedList(LinkedList[int]):
Expand Down