mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Delete many redundant method redefinitions (#6877)
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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]]: ...
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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): ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -95,7 +95,6 @@ if sys.platform == "win32":
|
||||
|
||||
name: str
|
||||
def __init__(self, fname: str) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
class Feature:
|
||||
|
||||
id: str
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user