mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Remove nearly all __str__ and __repr__ methods from typeshed (#6968)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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, ...]: ...
|
||||
|
||||
|
||||
@@ -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]: ...
|
||||
|
||||
@@ -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, ...]: ...
|
||||
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -94,7 +94,6 @@ if sys.platform == "win32":
|
||||
|
||||
name: str
|
||||
def __init__(self, fname: str) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
class Feature:
|
||||
|
||||
id: str
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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]: ...
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user