diff --git a/stdlib/asyncio/events.pyi b/stdlib/asyncio/events.pyi index 25b3846dee28..7cbc086b476b 100644 --- a/stdlib/asyncio/events.pyi +++ b/stdlib/asyncio/events.pyi @@ -32,7 +32,6 @@ class Handle: ) -> None: ... else: def __init__(self, callback: Callable[..., Any], args: Sequence[Any], loop: AbstractEventLoop) -> None: ... - def __repr__(self) -> str: ... def cancel(self) -> None: ... def _run(self) -> None: ... if sys.version_info >= (3, 7): diff --git a/stdlib/asyncio/futures.pyi b/stdlib/asyncio/futures.pyi index 9788123f427e..3ec16f28850e 100644 --- a/stdlib/asyncio/futures.pyi +++ b/stdlib/asyncio/futures.pyi @@ -34,7 +34,6 @@ class Future(Awaitable[_T], Iterable[_T]): _blocking = False _log_traceback = False def __init__(self, *, loop: AbstractEventLoop | None = ...) -> None: ... - def __repr__(self) -> str: ... def __del__(self) -> None: ... if sys.version_info >= (3, 7): def get_loop(self) -> AbstractEventLoop: ... diff --git a/stdlib/asyncio/proactor_events.pyi b/stdlib/asyncio/proactor_events.pyi index 3c5182a39642..64c65d847fcf 100644 --- a/stdlib/asyncio/proactor_events.pyi +++ b/stdlib/asyncio/proactor_events.pyi @@ -21,7 +21,6 @@ class _ProactorBasePipeTransport(transports._FlowControlMixin, transports.BaseTr extra: Mapping[Any, Any] | None = ..., server: events.AbstractServer | None = ..., ) -> None: ... - def __repr__(self) -> str: ... if sys.version_info >= (3, 8): def __del__(self, _warn: _WarnCallbackProtocol = ...) -> None: ... else: diff --git a/stdlib/asyncio/queues.pyi b/stdlib/asyncio/queues.pyi index aff4af727b08..994268f54f0a 100644 --- a/stdlib/asyncio/queues.pyi +++ b/stdlib/asyncio/queues.pyi @@ -15,8 +15,6 @@ class Queue(Generic[_T]): def _init(self, maxsize: int) -> None: ... def _get(self) -> _T: ... def _put(self, item: _T) -> None: ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... def _format(self) -> str: ... def qsize(self) -> int: ... @property diff --git a/stdlib/asyncio/tasks.pyi b/stdlib/asyncio/tasks.pyi index 4671b7787f56..c1c073895650 100644 --- a/stdlib/asyncio/tasks.pyi +++ b/stdlib/asyncio/tasks.pyi @@ -265,7 +265,6 @@ class Task(Future[_T], Generic[_T]): def __init__( self, coro: Generator[_TaskYieldType, None, _T] | Awaitable[_T], *, loop: AbstractEventLoop = ... ) -> None: ... - def __repr__(self) -> str: ... if sys.version_info >= (3, 8): def get_coro(self) -> Generator[_TaskYieldType, None, _T] | Awaitable[_T]: ... def get_name(self) -> str: ... diff --git a/stdlib/asyncio/windows_events.pyi b/stdlib/asyncio/windows_events.pyi index 1bb49c9650e4..e43a0eda8083 100644 --- a/stdlib/asyncio/windows_events.pyi +++ b/stdlib/asyncio/windows_events.pyi @@ -41,7 +41,6 @@ if sys.platform == "win32": ) -> list[PipeServer]: ... class IocpProactor: def __init__(self, concurrency: int = ...) -> None: ... - def __repr__(self) -> str: ... def __del__(self) -> None: ... def set_loop(self, loop: events.AbstractEventLoop) -> None: ... def select(self, timeout: int | None = ...) -> list[futures.Future[Any]]: ... diff --git a/stdlib/asyncio/windows_utils.pyi b/stdlib/asyncio/windows_utils.pyi index 5d07362faf9d..3c96b76fc4a1 100644 --- a/stdlib/asyncio/windows_utils.pyi +++ b/stdlib/asyncio/windows_utils.pyi @@ -16,7 +16,6 @@ if sys.platform == "win32": def pipe(*, duplex: bool = ..., overlapped: tuple[bool, bool] = ..., bufsize: int = ...) -> tuple[int, int]: ... class PipeHandle: def __init__(self, handle: int) -> None: ... - def __repr__(self) -> str: ... if sys.version_info >= (3, 8): def __del__(self, _warn: _WarnFunction = ...) -> None: ... else: diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 5abfbd953e78..e648b96c672e 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -261,7 +261,6 @@ class int: def __le__(self, __x: int) -> bool: ... def __gt__(self, __x: int) -> bool: ... def __ge__(self, __x: int) -> bool: ... - def __str__(self) -> str: ... def __float__(self) -> float: ... def __int__(self) -> int: ... def __abs__(self) -> int: ... @@ -319,7 +318,6 @@ class float: def __ge__(self, __x: float) -> bool: ... def __neg__(self) -> float: ... def __pos__(self) -> float: ... - def __str__(self) -> str: ... def __int__(self) -> int: ... def __float__(self) -> float: ... def __abs__(self) -> float: ... @@ -350,7 +348,6 @@ class complex: def __ne__(self, __x: object) -> bool: ... def __neg__(self) -> complex: ... def __pos__(self) -> complex: ... - def __str__(self) -> str: ... def __abs__(self) -> float: ... def __hash__(self) -> int: ... def __bool__(self) -> bool: ... @@ -441,9 +438,7 @@ class str(Sequence[str]): def __mod__(self, __x: Any) -> str: ... def __mul__(self, __n: SupportsIndex) -> str: ... def __ne__(self, __x: object) -> bool: ... - def __repr__(self) -> str: ... def __rmul__(self, n: SupportsIndex) -> str: ... - def __str__(self) -> str: ... def __getnewargs__(self) -> tuple[str]: ... class bytes(ByteString): @@ -525,8 +520,6 @@ class bytes(ByteString): def maketrans(__frm: bytes, __to: bytes) -> bytes: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[int]: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... def __hash__(self) -> int: ... @overload def __getitem__(self, __i: SupportsIndex) -> int: ... @@ -629,8 +622,6 @@ class bytearray(MutableSequence[int], ByteString): def maketrans(__frm: bytes, __to: bytes) -> bytes: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[int]: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... __hash__: None # type: ignore[assignment] @overload def __getitem__(self, __i: SupportsIndex) -> int: ... @@ -807,7 +798,6 @@ class list(MutableSequence[_T], Generic[_T]): def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> None: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T]: ... - def __str__(self) -> str: ... __hash__: None # type: ignore[assignment] @overload def __getitem__(self, __i: SupportsIndex) -> _T: ... @@ -867,7 +857,6 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): def __iter__(self) -> Iterator[_KT]: ... if sys.version_info >= (3, 8): def __reversed__(self) -> Iterator[_KT]: ... - def __str__(self) -> str: ... __hash__: None # type: ignore[assignment] if sys.version_info >= (3, 9): def __class_getitem__(cls, __item: Any) -> GenericAlias: ... @@ -895,7 +884,6 @@ class set(MutableSet[_T], Generic[_T]): def __len__(self) -> int: ... def __contains__(self, __o: object) -> bool: ... def __iter__(self) -> Iterator[_T]: ... - def __str__(self) -> str: ... def __and__(self, __s: AbstractSet[object]) -> set[_T]: ... def __iand__(self, __s: AbstractSet[object]) -> set[_T]: ... def __or__(self, __s: AbstractSet[_S]) -> set[_T | _S]: ... @@ -925,7 +913,6 @@ class frozenset(AbstractSet[_T_co], Generic[_T_co]): def __len__(self) -> int: ... def __contains__(self, __o: object) -> bool: ... def __iter__(self) -> Iterator[_T_co]: ... - def __str__(self) -> str: ... def __and__(self, __s: AbstractSet[_T_co]) -> frozenset[_T_co]: ... def __or__(self, __s: AbstractSet[_S]) -> frozenset[_T_co | _S]: ... def __sub__(self, __s: AbstractSet[_T_co]) -> frozenset[_T_co]: ... @@ -965,7 +952,6 @@ class range(Sequence[int]): def __getitem__(self, __i: SupportsIndex) -> int: ... @overload def __getitem__(self, __s: slice) -> range: ... - def __repr__(self) -> str: ... def __reversed__(self) -> Iterator[int]: ... class property: @@ -1526,8 +1512,6 @@ class BaseException: if sys.version_info >= (3, 11): __note__: str | None def __init__(self, *args: object) -> None: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... def with_traceback(self: _TBE, __tb: TracebackType | None) -> _TBE: ... class GeneratorExit(BaseException): ... diff --git a/stdlib/calendar.pyi b/stdlib/calendar.pyi index 86466d0cd846..108356610322 100644 --- a/stdlib/calendar.pyi +++ b/stdlib/calendar.pyi @@ -35,11 +35,9 @@ _LocaleType = tuple[Optional[str], Optional[str]] class IllegalMonthError(ValueError): def __init__(self, month: int) -> None: ... - def __str__(self) -> str: ... class IllegalWeekdayError(ValueError): def __init__(self, weekday: int) -> None: ... - def __str__(self) -> str: ... def isleap(year: int) -> bool: ... def leapdays(y1: int, y2: int) -> int: ... diff --git a/stdlib/cgi.pyi b/stdlib/cgi.pyi index c2c3ac261010..8eee5c69504d 100644 --- a/stdlib/cgi.pyi +++ b/stdlib/cgi.pyi @@ -53,7 +53,6 @@ class MiniFieldStorage: name: Any value: Any def __init__(self, name: Any, value: Any) -> None: ... - def __repr__(self) -> str: ... _list = list @@ -96,7 +95,6 @@ class FieldStorage: ) -> None: ... def __enter__(self: _T) -> _T: ... def __exit__(self, *args: Any) -> None: ... - def __repr__(self) -> str: ... def __iter__(self) -> Iterator[str]: ... def __getitem__(self, key: str) -> Any: ... def getvalue(self, key: str, default: Any = ...) -> Any: ... diff --git a/stdlib/collections/__init__.pyi b/stdlib/collections/__init__.pyi index 2c30602da48f..c1a046949f83 100644 --- a/stdlib/collections/__init__.pyi +++ b/stdlib/collections/__init__.pyi @@ -200,7 +200,6 @@ class deque(MutableSequence[_T], Generic[_T]): def rotate(self, __n: int = ...) -> None: ... def __copy__(self: _S) -> _S: ... def __len__(self) -> int: ... - def __str__(self) -> str: ... # These methods of deque don't take slices, unlike MutableSequence, hence the type: ignores def __getitem__(self, __index: SupportsIndex) -> _T: ... # type: ignore[override] def __setitem__(self, __i: SupportsIndex, __x: _T) -> None: ... # type: ignore[override] diff --git a/stdlib/concurrent/futures/process.pyi b/stdlib/concurrent/futures/process.pyi index 6435901a8f13..900c46e19f1c 100644 --- a/stdlib/concurrent/futures/process.pyi +++ b/stdlib/concurrent/futures/process.pyi @@ -31,7 +31,6 @@ _MAX_WINDOWS_WORKERS: int class _RemoteTraceback(Exception): tb: str def __init__(self, tb: TracebackType) -> None: ... - def __str__(self) -> str: ... class _ExceptionWithTraceback: exc: BaseException diff --git a/stdlib/decimal.pyi b/stdlib/decimal.pyi index 1bb81ab20da9..0fce0cb5aed1 100644 --- a/stdlib/decimal.pyi +++ b/stdlib/decimal.pyi @@ -80,7 +80,6 @@ class Decimal: def __rmul__(self, __other: _Decimal) -> Decimal: ... def __rsub__(self, __other: _Decimal) -> Decimal: ... def __rtruediv__(self, __other: _Decimal) -> Decimal: ... - def __str__(self) -> str: ... def __sub__(self, __other: _Decimal) -> Decimal: ... def __truediv__(self, __other: _Decimal) -> Decimal: ... def remainder_near(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... diff --git a/stdlib/dis.pyi b/stdlib/dis.pyi index ac0632d25c9c..15b44c96fbbd 100644 --- a/stdlib/dis.pyi +++ b/stdlib/dis.pyi @@ -38,7 +38,6 @@ class Bytecode: first_line: int def __init__(self, x: _HaveCodeOrStringType, *, first_line: int | None = ..., current_offset: int | None = ...) -> None: ... def __iter__(self) -> Iterator[Instruction]: ... - def __repr__(self) -> str: ... def info(self) -> str: ... def dis(self) -> str: ... @classmethod diff --git a/stdlib/email/charset.pyi b/stdlib/email/charset.pyi index 4bf5d11690eb..298b763540db 100644 --- a/stdlib/email/charset.pyi +++ b/stdlib/email/charset.pyi @@ -17,7 +17,6 @@ class Charset: def header_encode(self, string: str) -> str: ... def header_encode_lines(self, string: str, maxlengths: Iterator[int]) -> list[str]: ... def body_encode(self, string: str) -> str: ... - def __str__(self) -> str: ... def __eq__(self, other: Any) -> bool: ... def __ne__(self, other: Any) -> bool: ... diff --git a/stdlib/email/header.pyi b/stdlib/email/header.pyi index 4bebd50c45e4..4490c16a4eb6 100644 --- a/stdlib/email/header.pyi +++ b/stdlib/email/header.pyi @@ -13,7 +13,6 @@ class Header: ) -> None: ... def append(self, s: bytes | str, charset: Charset | str | None = ..., errors: str = ...) -> None: ... def encode(self, splitchars: str = ..., maxlinelen: int | None = ..., linesep: str = ...) -> str: ... - def __str__(self) -> str: ... def __eq__(self, other: Any) -> bool: ... def __ne__(self, other: Any) -> bool: ... diff --git a/stdlib/email/headerregistry.pyi b/stdlib/email/headerregistry.pyi index 962571eb7a7a..b84acab18ffe 100644 --- a/stdlib/email/headerregistry.pyi +++ b/stdlib/email/headerregistry.pyi @@ -159,7 +159,6 @@ class Address: def __init__( self, display_name: str = ..., username: str | None = ..., domain: str | None = ..., addr_spec: str | None = ... ) -> None: ... - def __str__(self) -> str: ... class Group: @property @@ -167,4 +166,3 @@ class Group: @property def addresses(self) -> tuple[Address, ...]: ... def __init__(self, display_name: str | None = ..., addresses: Iterable[Address] | None = ...) -> None: ... - def __str__(self) -> str: ... diff --git a/stdlib/email/message.pyi b/stdlib/email/message.pyi index 7d5eb4500d8f..5ce11e3d807e 100644 --- a/stdlib/email/message.pyi +++ b/stdlib/email/message.pyi @@ -17,7 +17,6 @@ class Message: preamble: str | None epilogue: str | None defects: list[MessageDefect] - def __str__(self) -> str: ... def is_multipart(self) -> bool: ... def set_unixfrom(self, unixfrom: str) -> None: ... def get_unixfrom(self) -> str | None: ... diff --git a/stdlib/enum.pyi b/stdlib/enum.pyi index 49f7bda4ee8e..b10b64546cb5 100644 --- a/stdlib/enum.pyi +++ b/stdlib/enum.pyi @@ -113,8 +113,6 @@ class Enum(metaclass=EnumMeta): @staticmethod def _generate_next_value_(name: str, start: int, count: int, last_values: list[Any]) -> Any: ... def __new__(cls: type[_T], value: object) -> _T: ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... def __dir__(self) -> list[str]: ... def __format__(self, format_spec: str) -> str: ... def __hash__(self) -> Any: ... @@ -159,8 +157,6 @@ class Flag(Enum): @types.DynamicClassAttribute def value(self) -> int: ... def __contains__(self: _T, other: _T) -> bool: ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... def __bool__(self) -> bool: ... def __or__(self: _T, other: _T) -> _T: ... def __and__(self: _T, other: _T) -> _T: ... diff --git a/stdlib/http/cookiejar.pyi b/stdlib/http/cookiejar.pyi index 6bfa7f385e69..1b4deb9b2ca1 100644 --- a/stdlib/http/cookiejar.pyi +++ b/stdlib/http/cookiejar.pyi @@ -27,8 +27,6 @@ class CookieJar(Iterable[Cookie]): def clear_expired_cookies(self) -> None: ... # undocumented def __iter__(self) -> Iterator[Cookie]: ... def __len__(self) -> int: ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... class FileCookieJar(CookieJar): filename: str diff --git a/stdlib/modulefinder.pyi b/stdlib/modulefinder.pyi index 3e7694ccffc9..4a1783efefd1 100644 --- a/stdlib/modulefinder.pyi +++ b/stdlib/modulefinder.pyi @@ -19,7 +19,6 @@ def ReplacePackage(oldname: str, newname: str) -> None: ... class Module: # undocumented def __init__(self, name: str, file: str | None = ..., path: str | None = ...) -> None: ... - def __repr__(self) -> str: ... class ModuleFinder: diff --git a/stdlib/msilib/__init__.pyi b/stdlib/msilib/__init__.pyi index 5933433ac00c..ba94e861f938 100644 --- a/stdlib/msilib/__init__.pyi +++ b/stdlib/msilib/__init__.pyi @@ -95,7 +95,6 @@ if sys.platform == "win32": name: str def __init__(self, fname: str) -> None: ... - def __repr__(self) -> str: ... class Feature: id: str diff --git a/stdlib/multiprocessing/managers.pyi b/stdlib/multiprocessing/managers.pyi index 79310614efc1..42853dfd31d5 100644 --- a/stdlib/multiprocessing/managers.pyi +++ b/stdlib/multiprocessing/managers.pyi @@ -32,7 +32,6 @@ class Token: address: tuple[str | bytes, int] id: str | bytes | int | None def __init__(self, typeid: bytes | str | None, address: tuple[str | bytes, int], id: str | bytes | int | None) -> None: ... - def __repr__(self) -> str: ... def __getstate__(self) -> tuple[str | bytes | None, tuple[str | bytes, int], str | bytes | int | None]: ... def __setstate__(self, state: tuple[str | bytes | None, tuple[str | bytes, int], str | bytes | int | None]) -> None: ... diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 8d9b20bf9a0d..925ade3d6859 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -738,7 +738,6 @@ if sys.version_info >= (3, 7): def _evaluate(self, globalns: dict[str, Any] | None, localns: dict[str, Any] | None) -> Any | None: ... def __eq__(self, other: Any) -> bool: ... def __hash__(self) -> int: ... - def __repr__(self) -> str: ... if sys.version_info >= (3, 11): def __or__(self, other: Any) -> _SpecialForm: ... def __ror__(self, other: Any) -> _SpecialForm: ... diff --git a/stdlib/weakref.pyi b/stdlib/weakref.pyi index 363f939a6761..53f5680e3cda 100644 --- a/stdlib/weakref.pyi +++ b/stdlib/weakref.pyi @@ -33,7 +33,6 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]): def __delitem__(self, v: _KT) -> None: ... def __contains__(self, o: object) -> bool: ... def __iter__(self) -> Iterator[_KT]: ... - def __str__(self) -> str: ... def copy(self) -> WeakValueDictionary[_KT, _VT]: ... # These are incompatible with Mapping def keys(self) -> Iterator[_KT]: ... # type: ignore[override] @@ -64,7 +63,6 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]): def __delitem__(self, v: _KT) -> None: ... def __contains__(self, o: object) -> bool: ... def __iter__(self) -> Iterator[_KT]: ... - def __str__(self) -> str: ... def copy(self) -> WeakKeyDictionary[_KT, _VT]: ... # These are incompatible with Mapping def keys(self) -> Iterator[_KT]: ... # type: ignore[override] diff --git a/stdlib/zipfile.pyi b/stdlib/zipfile.pyi index 4244229a1ad7..a0a968ac94b0 100644 --- a/stdlib/zipfile.pyi +++ b/stdlib/zipfile.pyi @@ -98,7 +98,6 @@ class ZipExtFile(io.BufferedIOBase): ) -> None: ... def read(self, n: int | None = ...) -> bytes: ... def readline(self, limit: int = ...) -> bytes: ... # type: ignore[override] - def __repr__(self) -> str: ... def peek(self, n: int = ...) -> bytes: ... def read1(self, n: int | None) -> bytes: ... # type: ignore[override] if sys.version_info >= (3, 7):