from _typeshed import Self
from typing import Any, Iterable, MutableSequence, Sequence, Text, overload

class UserString(Sequence[UserString]):
    data: unicode
    def __init__(self, seq: object) -> None: ...
    def __int__(self) -> int: ...
    def __long__(self) -> long: ...
    def __float__(self) -> float: ...
    def __complex__(self) -> complex: ...
    def __hash__(self) -> int: ...
    def __len__(self) -> int: ...
    @overload
    def __getitem__(self: Self, i: int) -> Self: ...
    @overload
    def __getitem__(self: Self, s: slice) -> Self: ...
    def __add__(self: Self, other: Any) -> Self: ...
    def __radd__(self: Self, other: Any) -> Self: ...
    def __mul__(self: Self, other: int) -> Self: ...
    def __rmul__(self: Self, other: int) -> Self: ...
    def __mod__(self: Self, args: Any) -> Self: ...
    def capitalize(self: Self) -> Self: ...
    def center(self: Self, width: int, *args: Any) -> Self: ...
    def count(self, sub: int, start: int = ..., end: int = ...) -> int: ...
    def decode(self: Self, encoding: str | None = ..., errors: str | None = ...) -> Self: ...
    def encode(self: Self, encoding: str | None = ..., errors: str | None = ...) -> Self: ...
    def endswith(self, suffix: Text | tuple[Text, ...], start: int | None = ..., end: int | None = ...) -> bool: ...
    def expandtabs(self: Self, tabsize: int = ...) -> Self: ...
    def find(self, sub: Text, start: int = ..., end: int = ...) -> int: ...
    def index(self, sub: Text, start: int = ..., end: int = ...) -> int: ...
    def isalpha(self) -> bool: ...
    def isalnum(self) -> bool: ...
    def isdecimal(self) -> bool: ...
    def isdigit(self) -> bool: ...
    def islower(self) -> bool: ...
    def isnumeric(self) -> bool: ...
    def isspace(self) -> bool: ...
    def istitle(self) -> bool: ...
    def isupper(self) -> bool: ...
    def join(self, seq: Iterable[Text]) -> Text: ...
    def ljust(self: Self, width: int, *args: Any) -> Self: ...
    def lower(self: Self) -> Self: ...
    def lstrip(self: Self, chars: Text | None = ...) -> Self: ...
    def partition(self, sep: Text) -> tuple[Text, Text, Text]: ...
    def replace(self: Self, old: Text, new: Text, maxsplit: int = ...) -> Self: ...
    def rfind(self, sub: Text, start: int = ..., end: int = ...) -> int: ...
    def rindex(self, sub: Text, start: int = ..., end: int = ...) -> int: ...
    def rjust(self: Self, width: int, *args: Any) -> Self: ...
    def rpartition(self, sep: Text) -> tuple[Text, Text, Text]: ...
    def rstrip(self: Self, chars: Text | None = ...) -> Self: ...
    def split(self, sep: Text | None = ..., maxsplit: int = ...) -> list[Text]: ...
    def rsplit(self, sep: Text | None = ..., maxsplit: int = ...) -> list[Text]: ...
    def splitlines(self, keepends: int = ...) -> list[Text]: ...
    def startswith(self, prefix: Text | tuple[Text, ...], start: int | None = ..., end: int | None = ...) -> bool: ...
    def strip(self: Self, chars: Text | None = ...) -> Self: ...
    def swapcase(self: Self) -> Self: ...
    def title(self: Self) -> Self: ...
    def translate(self: Self, *args: Any) -> Self: ...
    def upper(self: Self) -> Self: ...
    def zfill(self: Self, width: int) -> Self: ...

class MutableString(UserString, MutableSequence[MutableString]):
    @overload
    def __getitem__(self: Self, i: int) -> Self: ...
    @overload
    def __getitem__(self: Self, s: slice) -> Self: ...
    def __setitem__(self, index: int | slice, sub: Any) -> None: ...
    def __delitem__(self, index: int | slice) -> None: ...
    def immutable(self) -> UserString: ...
    def __iadd__(self: Self, other: Any) -> Self: ...
    def __imul__(self: Self, n: int) -> Self: ...
    def insert(self, index: int, value: Any) -> None: ...
