Remove nearly all __str__ and __repr__ methods from typeshed (#6968)

This commit is contained in:
Alex Waygood
2022-01-19 23:45:11 +00:00
committed by GitHub
parent fe6233a8c3
commit aea52b35d1
27 changed files with 11 additions and 72 deletions

View File

@@ -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, ...]: ...