diff --git a/stdlib/collections/__init__.pyi b/stdlib/collections/__init__.pyi index 9380fc426ddc..bce72464fd75 100644 --- a/stdlib/collections/__init__.pyi +++ b/stdlib/collections/__init__.pyi @@ -191,21 +191,23 @@ class UserString(Sequence[UserString]): def __reversed__(self) -> Iterator[Self]: ... def __add__(self, other: object) -> Self: ... def __radd__(self, other: object) -> Self: ... - def __mul__(self, n: int) -> Self: ... - def __rmul__(self, n: int) -> Self: ... + def __mul__(self, n: SupportsIndex) -> Self: ... + def __rmul__(self, n: SupportsIndex) -> Self: ... def __mod__(self, args: Any) -> Self: ... def __rmod__(self, template: object) -> Self: ... def capitalize(self) -> Self: ... def casefold(self) -> Self: ... - def center(self, width: int, *args: Any) -> Self: ... - def count(self, sub: str | UserString, start: int = 0, end: int = sys.maxsize) -> int: ... + def center(self, width: SupportsIndex, *args: Any) -> Self: ... + def count(self, sub: str | UserString, start: SupportsIndex | None = 0, end: SupportsIndex | None = sys.maxsize) -> int: ... def encode(self: UserString, encoding: str | None = "utf-8", errors: str | None = "strict") -> bytes: ... - def endswith(self, suffix: str | tuple[str, ...], start: int | None = 0, end: int | None = sys.maxsize) -> bool: ... - def expandtabs(self, tabsize: int = 8) -> Self: ... - def find(self, sub: str | UserString, start: int = 0, end: int = sys.maxsize) -> int: ... + def endswith( + self, suffix: str | tuple[str, ...], start: SupportsIndex | None = 0, end: SupportsIndex | None = sys.maxsize + ) -> bool: ... + def expandtabs(self, tabsize: SupportsIndex = 8) -> Self: ... + def find(self, sub: str | UserString, start: SupportsIndex | None = 0, end: SupportsIndex | None = sys.maxsize) -> int: ... def format(self, *args: Any, **kwds: Any) -> str: ... def format_map(self, mapping: Mapping[str, Any]) -> str: ... - def index(self, sub: str, start: int = 0, end: int = sys.maxsize) -> int: ... + def index(self, sub: str, start: SupportsIndex | None = 0, end: SupportsIndex | None = sys.maxsize) -> int: ... def isalpha(self) -> bool: ... def isalnum(self) -> bool: ... def isdecimal(self) -> bool: ... @@ -219,29 +221,31 @@ class UserString(Sequence[UserString]): def isupper(self) -> bool: ... def isascii(self) -> bool: ... def join(self, seq: Iterable[str]) -> str: ... - def ljust(self, width: int, *args: Any) -> Self: ... + def ljust(self, width: SupportsIndex, *args: Any) -> Self: ... def lower(self) -> Self: ... def lstrip(self, chars: str | None = None) -> Self: ... maketrans = str.maketrans def partition(self, sep: str) -> tuple[str, str, str]: ... def removeprefix(self, prefix: str | UserString, /) -> Self: ... def removesuffix(self, suffix: str | UserString, /) -> Self: ... - def replace(self, old: str | UserString, new: str | UserString, maxsplit: int = -1) -> Self: ... - def rfind(self, sub: str | UserString, start: int = 0, end: int = sys.maxsize) -> int: ... - def rindex(self, sub: str | UserString, start: int = 0, end: int = sys.maxsize) -> int: ... - def rjust(self, width: int, *args: Any) -> Self: ... + def replace(self, old: str | UserString, new: str | UserString, maxsplit: SupportsIndex = -1) -> Self: ... + def rfind(self, sub: str | UserString, start: SupportsIndex | None = 0, end: SupportsIndex | None = sys.maxsize) -> int: ... + def rindex(self, sub: str | UserString, start: SupportsIndex | None = 0, end: SupportsIndex | None = sys.maxsize) -> int: ... + def rjust(self, width: SupportsIndex, *args: Any) -> Self: ... def rpartition(self, sep: str) -> tuple[str, str, str]: ... def rstrip(self, chars: str | None = None) -> Self: ... - def split(self, sep: str | None = None, maxsplit: int = -1) -> list[str]: ... - def rsplit(self, sep: str | None = None, maxsplit: int = -1) -> list[str]: ... + def split(self, sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[str]: ... + def rsplit(self, sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[str]: ... def splitlines(self, keepends: bool = False) -> list[str]: ... - def startswith(self, prefix: str | tuple[str, ...], start: int | None = 0, end: int | None = sys.maxsize) -> bool: ... + def startswith( + self, prefix: str | tuple[str, ...], start: SupportsIndex | None = 0, end: SupportsIndex | None = sys.maxsize + ) -> bool: ... def strip(self, chars: str | None = None) -> Self: ... def swapcase(self) -> Self: ... def title(self) -> Self: ... def translate(self, *args: Any) -> Self: ... def upper(self) -> Self: ... - def zfill(self, width: int) -> Self: ... + def zfill(self, width: SupportsIndex) -> Self: ... @disjoint_base class deque(MutableSequence[_T]):