Skip to content

Delete many redundant method redefinitions #6877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jan 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion stdlib/asyncio/events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 0 additions & 1 deletion stdlib/asyncio/futures.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/asyncio/proactor_events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions stdlib/asyncio/queues.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion stdlib/asyncio/tasks.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/asyncio/windows_events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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]]: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/asyncio/windows_utils.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 0 additions & 16 deletions stdlib/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down Expand Up @@ -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: ...
Expand Down Expand Up @@ -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: ...
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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: ...
Expand Down Expand Up @@ -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: ...
Expand Down Expand Up @@ -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: ...
Expand Down Expand Up @@ -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: ...
Expand Down Expand Up @@ -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]: ...
Expand Down Expand Up @@ -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]: ...
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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): ...
Expand Down
2 changes: 0 additions & 2 deletions stdlib/calendar.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
2 changes: 0 additions & 2 deletions stdlib/cgi.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class MiniFieldStorage:
name: Any
value: Any
def __init__(self, name: Any, value: Any) -> None: ...
def __repr__(self) -> str: ...

_list = list

Expand Down Expand Up @@ -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: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/collections/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 0 additions & 1 deletion stdlib/concurrent/futures/process.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion stdlib/decimal.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/dis.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion stdlib/email/charset.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...

Expand Down
1 change: 0 additions & 1 deletion stdlib/email/header.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...

Expand Down
2 changes: 0 additions & 2 deletions stdlib/email/headerregistry.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,10 @@ 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
def display_name(self) -> str | None: ...
@property
def addresses(self) -> tuple[Address, ...]: ...
def __init__(self, display_name: str | None = ..., addresses: Iterable[Address] | None = ...) -> None: ...
def __str__(self) -> str: ...
1 change: 0 additions & 1 deletion stdlib/email/message.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
4 changes: 0 additions & 4 deletions stdlib/enum.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down Expand Up @@ -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: ...
Expand Down
2 changes: 0 additions & 2 deletions stdlib/http/cookiejar.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion stdlib/modulefinder.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
1 change: 0 additions & 1 deletion stdlib/msilib/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ if sys.platform == "win32":

name: str
def __init__(self, fname: str) -> None: ...
def __repr__(self) -> str: ...
class Feature:

id: str
Expand Down
1 change: 0 additions & 1 deletion stdlib/multiprocessing/managers.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...

Expand Down
1 change: 0 additions & 1 deletion stdlib/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
2 changes: 0 additions & 2 deletions stdlib/weakref.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down
1 change: 0 additions & 1 deletion stdlib/zipfile.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down