Skip to content

Commit 7e176d0

Browse files
danieleadesdaniel.eades
authored andcommitted
use 'Self' in ViewList class
1 parent de8e973 commit 7e176d0

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

stubs/docutils/docutils/statemachine.pyi

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from collections.abc import Callable, Generator, Iterable, Iterator, Sequence
22
from re import Match, Pattern
3-
from typing import Any, ClassVar, Generic, SupportsIndex, TypeVar, overload
3+
from typing import Any, ClassVar, Generic, SupportsIndex, TypeVar, overload, Self
44
from typing_extensions import Self, TypeAlias
55

66
_T = TypeVar("_T")
@@ -114,14 +114,14 @@ class SearchStateMachineWS(_SearchOverride, StateMachineWS[_Context]): ...
114114
class ViewList(Generic[_T]):
115115
data: list[_T]
116116
items: list[tuple[str, int]]
117-
parent: ViewList[_T]
117+
parent: Self
118118
parent_offset: int
119119
def __init__(
120120
self,
121-
initlist: ViewList[_T] | Sequence[_T] | None = None,
121+
initlist: Self | Sequence[_T] | None = None,
122122
source: str | None = None,
123123
items: list[tuple[str, int]] | None = None,
124-
parent: ViewList[_T] | None = None,
124+
parent: Self | None = None,
125125
parent_offset: int | None = None,
126126
) -> None: ...
127127
def __lt__(self, other: Any) -> bool: ...
@@ -130,24 +130,24 @@ class ViewList(Generic[_T]):
130130
def __ne__(self, other: object) -> bool: ...
131131
def __gt__(self, other: Any) -> bool: ...
132132
def __ge__(self, other: Any) -> bool: ...
133-
def __contains__(self, item: ViewList[_T]) -> bool: ...
133+
def __contains__(self, item: Self) -> bool: ...
134134
def __len__(self) -> int: ...
135135
@overload
136-
def __getitem__(self, i: slice) -> ViewList[_T]: ...
136+
def __getitem__(self, i: slice) -> Self: ...
137137
@overload
138138
def __getitem__(self, i: SupportsIndex) -> _T: ...
139139
@overload
140-
def __setitem__(self, i: slice, item: ViewList[_T]) -> None: ...
140+
def __setitem__(self, i: slice, item: Self) -> None: ...
141141
@overload
142142
def __setitem__(self, i: SupportsIndex, item: _T) -> None: ...
143143
def __delitem__(self, i: SupportsIndex) -> None: ...
144-
def __add__(self, other: ViewList[_T]) -> Self: ...
145-
def __radd__(self, other: ViewList[_T]) -> Self: ...
146-
def __iadd__(self, other: ViewList[_T]) -> Self: ...
144+
def __add__(self, other: Self) -> Self: ...
145+
def __radd__(self, other: Self) -> Self: ...
146+
def __iadd__(self, other: Self) -> Self: ...
147147
def __mul__(self, n: int) -> Self: ...
148148
__rmul__ = __mul__
149149
def __imul__(self, n: int) -> Self: ...
150-
def extend(self, other: ViewList[_T]) -> None: ...
150+
def extend(self, other: Self) -> None: ...
151151
def append(self, item: _T, source: str | None = None, offset: int = 0) -> None: ...
152152
def insert(self, i: int, item: _T, source: str | None = None, offset: int = 0) -> None: ...
153153
def pop(self, i: int = -1) -> _T: ...

0 commit comments

Comments
 (0)