From aea52b35d1f5a9306f66e1b98314f4ecbe0ffa7a Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 19 Jan 2022 23:45:11 +0000 Subject: [PATCH] Remove nearly all `__str__` and `__repr__` methods from typeshed (#6968) --- stdlib/@python2/ConfigParser.pyi | 2 -- stdlib/@python2/__builtin__.pyi | 19 ++----------------- stdlib/@python2/bdb.pyi | 1 - stdlib/@python2/builtins.pyi | 19 ++----------------- stdlib/@python2/calendar.pyi | 2 -- stdlib/@python2/cgi.pyi | 2 -- stdlib/@python2/collections.pyi | 1 - stdlib/@python2/decimal.pyi | 2 +- stdlib/@python2/distutils/version.pyi | 5 ++--- stdlib/@python2/getopt.pyi | 1 - stdlib/@python2/modulefinder.pyi | 1 - stdlib/@python2/msilib/__init__.pyi | 1 - stdlib/@python2/sets.pyi | 2 -- stdlib/@python2/weakref.pyi | 2 -- stdlib/@python2/zipfile.pyi | 1 - stdlib/bdb.pyi | 1 - stdlib/builtins.pyi | 4 ++-- stdlib/distutils/version.pyi | 5 ++--- stubs/colorama/colorama/win32.pyi | 1 - stubs/enum34/@python2/enum.pyi | 4 ---- stubs/filelock/filelock/__init__.pyi | 1 - .../frozendict/@tests/stubtest_allowlist.txt | 1 - stubs/frozendict/frozendict.pyi | 1 - .../google/protobuf/internal/containers.pyi | 1 - stubs/python-dateutil/dateutil/_common.pyi | 1 - .../dateutil/relativedelta.pyi | 1 - stubs/python-gflags/gflags.pyi | 1 - 27 files changed, 11 insertions(+), 72 deletions(-) diff --git a/stdlib/@python2/ConfigParser.pyi b/stdlib/@python2/ConfigParser.pyi index d8bd0c6e7..ebf2a434e 100644 --- a/stdlib/@python2/ConfigParser.pyi +++ b/stdlib/@python2/ConfigParser.pyi @@ -9,8 +9,6 @@ class Error(Exception): def __init__(self, msg: str = ...) -> None: ... def _get_message(self) -> None: ... def _set_message(self, value: str) -> None: ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... class NoSectionError(Error): section: str diff --git a/stdlib/@python2/__builtin__.pyi b/stdlib/@python2/__builtin__.pyi index 7fda79c93..d5e1c2e5e 100644 --- a/stdlib/@python2/__builtin__.pyi +++ b/stdlib/@python2/__builtin__.pyi @@ -69,8 +69,8 @@ class object: def __setattr__(self, name: str, value: Any) -> None: ... def __eq__(self, o: object) -> bool: ... def __ne__(self, o: object) -> bool: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... + def __str__(self) -> str: ... # noqa Y029 + def __repr__(self) -> str: ... # noqa Y029 def __hash__(self) -> int: ... def __format__(self, format_spec: str) -> str: ... def __getattribute__(self, name: str) -> Any: ... @@ -182,7 +182,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: ... @@ -232,7 +231,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: ... @@ -265,7 +263,6 @@ class complex: def __ne__(self, x: object) -> bool: ... def __neg__(self) -> complex: ... def __pos__(self) -> complex: ... - def __str__(self) -> str: ... def __complex__(self) -> complex: ... def __abs__(self) -> float: ... def __hash__(self) -> int: ... @@ -341,8 +338,6 @@ class unicode(basestring, Sequence[unicode]): # The argument type is incompatible with Sequence def __contains__(self, s: unicode | bytes) -> bool: ... # type: ignore def __iter__(self) -> Iterator[unicode]: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... def __int__(self) -> int: ... def __float__(self) -> float: ... def __hash__(self) -> int: ... @@ -432,9 +427,7 @@ class str(Sequence[str], basestring): def __mod__(self, x: Any) -> str: ... def __mul__(self, n: int) -> str: ... def __ne__(self, x: object) -> bool: ... - def __repr__(self) -> str: ... def __rmul__(self, n: int) -> str: ... - def __str__(self) -> str: ... def __getnewargs__(self) -> tuple[str]: ... def __getslice__(self, start: int, stop: int) -> str: ... def __float__(self) -> float: ... @@ -495,8 +488,6 @@ class bytearray(MutableSequence[int], ByteString): def fromhex(cls, __string: str) -> bytearray: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[int]: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... def __int__(self) -> int: ... def __float__(self) -> float: ... __hash__: None # type: ignore @@ -630,7 +621,6 @@ class list(MutableSequence[_T], Generic[_T]): def sort(self, cmp: Callable[[_T, _T], Any] = ..., key: Callable[[_T], Any] = ..., reverse: bool = ...) -> None: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T]: ... - def __str__(self) -> str: ... __hash__: None # type: ignore @overload def __getitem__(self, i: int) -> _T: ... @@ -693,7 +683,6 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): def __setitem__(self, k: _KT, v: _VT) -> None: ... def __delitem__(self, v: _KT) -> None: ... def __iter__(self) -> Iterator[_KT]: ... - def __str__(self) -> str: ... __hash__: None # type: ignore class set(MutableSet[_T], Generic[_T]): @@ -718,7 +707,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]: ... @@ -752,7 +740,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]: ... @@ -1061,8 +1048,6 @@ class BaseException(object): args: tuple[Any, ...] message: Any def __init__(self, *args: object) -> None: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... def __getitem__(self, i: int) -> Any: ... def __getslice__(self, start: int, stop: int) -> tuple[Any, ...]: ... diff --git a/stdlib/@python2/bdb.pyi b/stdlib/@python2/bdb.pyi index fcb93c2bb..3610bed14 100644 --- a/stdlib/@python2/bdb.pyi +++ b/stdlib/@python2/bdb.pyi @@ -87,7 +87,6 @@ class Breakpoint: def disable(self) -> None: ... def bpprint(self, out: IO[str] | None = ...) -> None: ... def bpformat(self) -> str: ... - def __str__(self) -> str: ... def checkfuncname(b: Breakpoint, frame: FrameType) -> bool: ... def effective(file: str, line: int, frame: FrameType) -> tuple[Breakpoint, bool] | tuple[None, None]: ... diff --git a/stdlib/@python2/builtins.pyi b/stdlib/@python2/builtins.pyi index 7fda79c93..d5e1c2e5e 100644 --- a/stdlib/@python2/builtins.pyi +++ b/stdlib/@python2/builtins.pyi @@ -69,8 +69,8 @@ class object: def __setattr__(self, name: str, value: Any) -> None: ... def __eq__(self, o: object) -> bool: ... def __ne__(self, o: object) -> bool: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... + def __str__(self) -> str: ... # noqa Y029 + def __repr__(self) -> str: ... # noqa Y029 def __hash__(self) -> int: ... def __format__(self, format_spec: str) -> str: ... def __getattribute__(self, name: str) -> Any: ... @@ -182,7 +182,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: ... @@ -232,7 +231,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: ... @@ -265,7 +263,6 @@ class complex: def __ne__(self, x: object) -> bool: ... def __neg__(self) -> complex: ... def __pos__(self) -> complex: ... - def __str__(self) -> str: ... def __complex__(self) -> complex: ... def __abs__(self) -> float: ... def __hash__(self) -> int: ... @@ -341,8 +338,6 @@ class unicode(basestring, Sequence[unicode]): # The argument type is incompatible with Sequence def __contains__(self, s: unicode | bytes) -> bool: ... # type: ignore def __iter__(self) -> Iterator[unicode]: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... def __int__(self) -> int: ... def __float__(self) -> float: ... def __hash__(self) -> int: ... @@ -432,9 +427,7 @@ class str(Sequence[str], basestring): def __mod__(self, x: Any) -> str: ... def __mul__(self, n: int) -> str: ... def __ne__(self, x: object) -> bool: ... - def __repr__(self) -> str: ... def __rmul__(self, n: int) -> str: ... - def __str__(self) -> str: ... def __getnewargs__(self) -> tuple[str]: ... def __getslice__(self, start: int, stop: int) -> str: ... def __float__(self) -> float: ... @@ -495,8 +488,6 @@ class bytearray(MutableSequence[int], ByteString): def fromhex(cls, __string: str) -> bytearray: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[int]: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... def __int__(self) -> int: ... def __float__(self) -> float: ... __hash__: None # type: ignore @@ -630,7 +621,6 @@ class list(MutableSequence[_T], Generic[_T]): def sort(self, cmp: Callable[[_T, _T], Any] = ..., key: Callable[[_T], Any] = ..., reverse: bool = ...) -> None: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T]: ... - def __str__(self) -> str: ... __hash__: None # type: ignore @overload def __getitem__(self, i: int) -> _T: ... @@ -693,7 +683,6 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): def __setitem__(self, k: _KT, v: _VT) -> None: ... def __delitem__(self, v: _KT) -> None: ... def __iter__(self) -> Iterator[_KT]: ... - def __str__(self) -> str: ... __hash__: None # type: ignore class set(MutableSet[_T], Generic[_T]): @@ -718,7 +707,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]: ... @@ -752,7 +740,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]: ... @@ -1061,8 +1048,6 @@ class BaseException(object): args: tuple[Any, ...] message: Any def __init__(self, *args: object) -> None: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... def __getitem__(self, i: int) -> Any: ... def __getslice__(self, start: int, stop: int) -> tuple[Any, ...]: ... diff --git a/stdlib/@python2/calendar.pyi b/stdlib/@python2/calendar.pyi index cd0ec70a4..f21e6406a 100644 --- a/stdlib/@python2/calendar.pyi +++ b/stdlib/@python2/calendar.pyi @@ -6,11 +6,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/@python2/cgi.pyi b/stdlib/@python2/cgi.pyi index 2b2b82a58..6c83a9c27 100644 --- a/stdlib/@python2/cgi.pyi +++ b/stdlib/@python2/cgi.pyi @@ -38,7 +38,6 @@ class MiniFieldStorage: name: Any value: Any def __init__(self, name: Any, value: Any) -> None: ... - def __repr__(self) -> str: ... class FieldStorage(object): FieldStorageClass: _type | None @@ -72,7 +71,6 @@ class FieldStorage(object): keep_blank_values: int = ..., strict_parsing: int = ..., ) -> 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/@python2/collections.pyi b/stdlib/@python2/collections.pyi index 706e8624c..ca2d78be5 100644 --- a/stdlib/@python2/collections.pyi +++ b/stdlib/@python2/collections.pyi @@ -51,7 +51,6 @@ class deque(Sized, Iterable[_T], Reversible[_T], Generic[_T]): def rotate(self, n: int = ...) -> None: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T]: ... - def __str__(self) -> str: ... def __hash__(self) -> int: ... def __getitem__(self, i: int) -> _T: ... def __setitem__(self, i: int, x: _T) -> None: ... diff --git a/stdlib/@python2/decimal.pyi b/stdlib/@python2/decimal.pyi index f798d8811..09bbe894b 100644 --- a/stdlib/@python2/decimal.pyi +++ b/stdlib/@python2/decimal.pyi @@ -73,7 +73,7 @@ class Decimal(object): def __rmul__(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... def __rsub__(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... def __rtruediv__(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... - def __str__(self, eng: bool = ..., context: Context | None = ...) -> str: ... + def __str__(self, eng: bool = ..., context: Context | None = ...) -> str: ... # noqa Y029 def __sub__(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... def __truediv__(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... def remainder_near(self, other: _Decimal, context: Context | None = ...) -> Decimal: ... diff --git a/stdlib/@python2/distutils/version.pyi b/stdlib/@python2/distutils/version.pyi index a9c4bee32..b3bb9ea49 100644 --- a/stdlib/@python2/distutils/version.pyi +++ b/stdlib/@python2/distutils/version.pyi @@ -5,7 +5,6 @@ from typing import Pattern, Text, TypeVar _T = TypeVar("_T", bound=Version) class Version: - def __repr__(self) -> str: ... @abstractmethod def __init__(self, vstring: Text | None = ...) -> None: ... @abstractmethod @@ -21,7 +20,7 @@ class StrictVersion(Version): prerelease: tuple[Text, int] | None def __init__(self, vstring: Text | None = ...) -> None: ... def parse(self: Self, vstring: Text) -> Self: ... - def __str__(self) -> str: ... + def __str__(self) -> str: ... # noqa Y029 def __cmp__(self: _T, other: _T | str) -> bool: ... class LooseVersion(Version): @@ -30,5 +29,5 @@ class LooseVersion(Version): version: tuple[Text | int, ...] def __init__(self, vstring: Text | None = ...) -> None: ... def parse(self: Self, vstring: Text) -> Self: ... - def __str__(self) -> str: ... + def __str__(self) -> str: ... # noqa Y029 def __cmp__(self: _T, other: _T | str) -> bool: ... diff --git a/stdlib/@python2/getopt.pyi b/stdlib/@python2/getopt.pyi index 43a01ee73..b1e90a6c5 100644 --- a/stdlib/@python2/getopt.pyi +++ b/stdlib/@python2/getopt.pyi @@ -2,7 +2,6 @@ class GetoptError(Exception): opt: str msg: str def __init__(self, msg: str, opt: str = ...) -> None: ... - def __str__(self) -> str: ... error = GetoptError diff --git a/stdlib/@python2/modulefinder.pyi b/stdlib/@python2/modulefinder.pyi index c319712ca..458b03772 100644 --- a/stdlib/@python2/modulefinder.pyi +++ b/stdlib/@python2/modulefinder.pyi @@ -18,7 +18,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/@python2/msilib/__init__.pyi b/stdlib/@python2/msilib/__init__.pyi index 8a97e3cec..381ddffa5 100644 --- a/stdlib/@python2/msilib/__init__.pyi +++ b/stdlib/@python2/msilib/__init__.pyi @@ -94,7 +94,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/@python2/sets.pyi b/stdlib/@python2/sets.pyi index 5d1974a55..916cb3def 100644 --- a/stdlib/@python2/sets.pyi +++ b/stdlib/@python2/sets.pyi @@ -7,8 +7,6 @@ _Setlike = Union[BaseSet[_T], Iterable[_T]] class BaseSet(Iterable[_T]): def __init__(self) -> None: ... def __len__(self) -> int: ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... def __iter__(self) -> Iterator[_T]: ... def __cmp__(self, other: Any) -> int: ... def __eq__(self, other: Any) -> bool: ... diff --git a/stdlib/@python2/weakref.pyi b/stdlib/@python2/weakref.pyi index aae85deba..8c65ab21a 100644 --- a/stdlib/@python2/weakref.pyi +++ b/stdlib/@python2/weakref.pyi @@ -30,7 +30,6 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]): def has_key(self, key: object) -> bool: ... def __contains__(self, o: object) -> bool: ... def __iter__(self) -> Iterator[_KT]: ... - def __str__(self) -> str: ... def copy(self) -> WeakValueDictionary[_KT, _VT]: ... def keys(self) -> list[_KT]: ... def values(self) -> list[_VT]: ... @@ -59,7 +58,6 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]): def has_key(self, key: object) -> bool: ... def __contains__(self, o: object) -> bool: ... def __iter__(self) -> Iterator[_KT]: ... - def __str__(self) -> str: ... def copy(self) -> WeakKeyDictionary[_KT, _VT]: ... def keys(self) -> list[_KT]: ... def values(self) -> list[_VT]: ... diff --git a/stdlib/@python2/zipfile.pyi b/stdlib/@python2/zipfile.pyi index 2bafc44aa..b5db240bd 100644 --- a/stdlib/@python2/zipfile.pyi +++ b/stdlib/@python2/zipfile.pyi @@ -31,7 +31,6 @@ class ZipExtFile(io.BufferedIOBase): ) -> None: ... def read(self, n: int | None = ...) -> bytes: ... def readline(self, limit: int = ...) -> bytes: ... # type: ignore - def __repr__(self) -> str: ... def peek(self, n: int = ...) -> bytes: ... def read1(self, n: int | None) -> bytes: ... # type: ignore diff --git a/stdlib/bdb.pyi b/stdlib/bdb.pyi index d61c7d3fd..d32dd4468 100644 --- a/stdlib/bdb.pyi +++ b/stdlib/bdb.pyi @@ -90,7 +90,6 @@ class Breakpoint: def disable(self) -> None: ... def bpprint(self, out: IO[str] | None = ...) -> None: ... def bpformat(self) -> str: ... - def __str__(self) -> str: ... def checkfuncname(b: Breakpoint, frame: FrameType) -> bool: ... def effective(file: str, line: int, frame: FrameType) -> tuple[Breakpoint, bool] | tuple[None, None]: ... diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 1a7eb59a3..8abdf0afd 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -94,8 +94,8 @@ class object: def __setattr__(self, __name: str, __value: Any) -> None: ... def __eq__(self, __o: object) -> bool: ... def __ne__(self, __o: object) -> bool: ... - def __str__(self) -> str: ... - def __repr__(self) -> str: ... + def __str__(self) -> str: ... # noqa Y029 + def __repr__(self) -> str: ... # noqa Y029 def __hash__(self) -> int: ... def __format__(self, __format_spec: str) -> str: ... def __getattribute__(self, __name: str) -> Any: ... diff --git a/stdlib/distutils/version.pyi b/stdlib/distutils/version.pyi index 846e1d178..210aa5cf7 100644 --- a/stdlib/distutils/version.pyi +++ b/stdlib/distutils/version.pyi @@ -3,7 +3,6 @@ from abc import abstractmethod from typing import Pattern class Version: - def __repr__(self) -> str: ... def __eq__(self, other: object) -> bool: ... def __lt__(self: Self, other: Self | str) -> bool: ... def __le__(self: Self, other: Self | str) -> bool: ... @@ -24,7 +23,7 @@ class StrictVersion(Version): prerelease: tuple[str, int] | None def __init__(self, vstring: str | None = ...) -> None: ... def parse(self: Self, vstring: str) -> Self: ... - def __str__(self) -> str: ... + def __str__(self) -> str: ... # noqa Y029 def _cmp(self: Self, other: Self | str) -> bool: ... class LooseVersion(Version): @@ -33,5 +32,5 @@ class LooseVersion(Version): version: tuple[str | int, ...] def __init__(self, vstring: str | None = ...) -> None: ... def parse(self: Self, vstring: str) -> Self: ... - def __str__(self) -> str: ... + def __str__(self) -> str: ... # noqa Y029 def _cmp(self: Self, other: Self | str) -> bool: ... diff --git a/stubs/colorama/colorama/win32.pyi b/stubs/colorama/colorama/win32.pyi index 37e6a0b99..554603de8 100644 --- a/stubs/colorama/colorama/win32.pyi +++ b/stubs/colorama/colorama/win32.pyi @@ -16,7 +16,6 @@ if sys.platform == "win32": wAttributes: wintypes.WORD srWindow: wintypes.SMALL_RECT dwMaximumWindowSize: COORD - def __str__(self) -> str: ... def winapi_test() -> bool: ... def GetConsoleScreenBufferInfo(stream_id: int = ...) -> CONSOLE_SCREEN_BUFFER_INFO: ... def SetConsoleTextAttribute(stream_id: int, attrs: wintypes.WORD) -> wintypes.BOOL: ... diff --git a/stubs/enum34/@python2/enum.pyi b/stubs/enum34/@python2/enum.pyi index 34e18d8fd..1e0d3d1ca 100644 --- a/stubs/enum34/@python2/enum.pyi +++ b/stubs/enum34/@python2/enum.pyi @@ -37,8 +37,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[Self], value: object) -> Self: ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... def __dir__(self) -> list[str]: ... def __format__(self, format_spec: str) -> str: ... def __hash__(self) -> Any: ... @@ -57,8 +55,6 @@ class auto(IntFlag): class Flag(Enum): def __contains__(self: _T, other: _T) -> bool: ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... def __bool__(self) -> bool: ... def __or__(self: Self, other: Self) -> Self: ... def __and__(self: Self, other: Self) -> Self: ... diff --git a/stubs/filelock/filelock/__init__.pyi b/stubs/filelock/filelock/__init__.pyi index b083297a9..1d66887f1 100644 --- a/stubs/filelock/filelock/__init__.pyi +++ b/stubs/filelock/filelock/__init__.pyi @@ -4,7 +4,6 @@ from types import TracebackType class Timeout(TimeoutError): def __init__(self, lock_file: str) -> None: ... - def __str__(self) -> str: ... class _Acquire_ReturnProxy: def __init__(self, lock: str) -> None: ... diff --git a/stubs/frozendict/@tests/stubtest_allowlist.txt b/stubs/frozendict/@tests/stubtest_allowlist.txt index 8941c269f..6a780fb4e 100644 --- a/stubs/frozendict/@tests/stubtest_allowlist.txt +++ b/stubs/frozendict/@tests/stubtest_allowlist.txt @@ -1,5 +1,4 @@ frozendict.FrozenOrderedDict frozendict.frozendict.__hash__ frozendict.frozendict.__new__ -frozendict.frozendict.__repr__ frozendict.frozendict.copy diff --git a/stubs/frozendict/frozendict.pyi b/stubs/frozendict/frozendict.pyi index a36f9712f..e73ad5bc0 100644 --- a/stubs/frozendict/frozendict.pyi +++ b/stubs/frozendict/frozendict.pyi @@ -19,7 +19,6 @@ class frozendict(Mapping[_KT, _VT], Generic[_KT, _VT]): def copy(self: Self, **add_or_replace: _VT) -> Self: ... def __iter__(self) -> Iterator[_KT]: ... def __len__(self) -> int: ... - def __repr__(self) -> str: ... def __hash__(self) -> int: ... class FrozenOrderedDict(frozendict[_KT, _VT]): diff --git a/stubs/protobuf/google/protobuf/internal/containers.pyi b/stubs/protobuf/google/protobuf/internal/containers.pyi index c7c26dc05..d87885b69 100644 --- a/stubs/protobuf/google/protobuf/internal/containers.pyi +++ b/stubs/protobuf/google/protobuf/internal/containers.pyi @@ -18,7 +18,6 @@ class BaseContainer(Sequence[_T]): def __len__(self) -> int: ... def __ne__(self, other: object) -> bool: ... def __hash__(self) -> int: ... - def __repr__(self) -> str: ... def sort(self, *, key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ...) -> None: ... @overload def __getitem__(self, key: SupportsIndex) -> _T: ... diff --git a/stubs/python-dateutil/dateutil/_common.pyi b/stubs/python-dateutil/dateutil/_common.pyi index 71d72ce29..878a7af46 100644 --- a/stubs/python-dateutil/dateutil/_common.pyi +++ b/stubs/python-dateutil/dateutil/_common.pyi @@ -4,7 +4,6 @@ class weekday(object): def __init__(self, weekday: int, n: int | None = ...) -> None: ... def __call__(self: Self, n: int) -> Self: ... def __eq__(self, other: object) -> bool: ... - def __repr__(self) -> str: ... def __hash__(self) -> int: ... weekday: int n: int diff --git a/stubs/python-dateutil/dateutil/relativedelta.pyi b/stubs/python-dateutil/dateutil/relativedelta.pyi index 4155078dd..c19edd0bf 100644 --- a/stubs/python-dateutil/dateutil/relativedelta.pyi +++ b/stubs/python-dateutil/dateutil/relativedelta.pyi @@ -94,6 +94,5 @@ class relativedelta(object): def __ne__(self, other: object) -> bool: ... def __div__(self: Self, other: SupportsFloat) -> Self: ... def __truediv__(self: Self, other: SupportsFloat) -> Self: ... - def __repr__(self) -> str: ... def __abs__(self: Self) -> Self: ... def __hash__(self) -> int: ... diff --git a/stubs/python-gflags/gflags.pyi b/stubs/python-gflags/gflags.pyi index bc674935c..9f651a093 100644 --- a/stubs/python-gflags/gflags.pyi +++ b/stubs/python-gflags/gflags.pyi @@ -70,7 +70,6 @@ class FlagValues: def RegisteredFlags(self) -> list[str]: ... def flag_values_dict(self) -> dict[str, Any]: ... FlagValuesDict = flag_values_dict - def __str__(self) -> str: ... def GetHelp(self, prefix: str = ...) -> str: ... def module_help(self, module: ModuleType | str) -> str: ... ModuleHelp = module_help