Skip to content

Commit 4e04616

Browse files
authored
Delete many redundant method redefinitions (#6877)
1 parent bb6a6e3 commit 4e04616

26 files changed

+0
-50
lines changed

stdlib/asyncio/events.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class Handle:
3232
) -> None: ...
3333
else:
3434
def __init__(self, callback: Callable[..., Any], args: Sequence[Any], loop: AbstractEventLoop) -> None: ...
35-
def __repr__(self) -> str: ...
3635
def cancel(self) -> None: ...
3736
def _run(self) -> None: ...
3837
if sys.version_info >= (3, 7):

stdlib/asyncio/futures.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class Future(Awaitable[_T], Iterable[_T]):
3434
_blocking = False
3535
_log_traceback = False
3636
def __init__(self, *, loop: AbstractEventLoop | None = ...) -> None: ...
37-
def __repr__(self) -> str: ...
3837
def __del__(self) -> None: ...
3938
if sys.version_info >= (3, 7):
4039
def get_loop(self) -> AbstractEventLoop: ...

stdlib/asyncio/proactor_events.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class _ProactorBasePipeTransport(transports._FlowControlMixin, transports.BaseTr
2121
extra: Mapping[Any, Any] | None = ...,
2222
server: events.AbstractServer | None = ...,
2323
) -> None: ...
24-
def __repr__(self) -> str: ...
2524
if sys.version_info >= (3, 8):
2625
def __del__(self, _warn: _WarnCallbackProtocol = ...) -> None: ...
2726
else:

stdlib/asyncio/queues.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ class Queue(Generic[_T]):
1515
def _init(self, maxsize: int) -> None: ...
1616
def _get(self) -> _T: ...
1717
def _put(self, item: _T) -> None: ...
18-
def __repr__(self) -> str: ...
19-
def __str__(self) -> str: ...
2018
def _format(self) -> str: ...
2119
def qsize(self) -> int: ...
2220
@property

stdlib/asyncio/tasks.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ class Task(Future[_T], Generic[_T]):
265265
def __init__(
266266
self, coro: Generator[_TaskYieldType, None, _T] | Awaitable[_T], *, loop: AbstractEventLoop = ...
267267
) -> None: ...
268-
def __repr__(self) -> str: ...
269268
if sys.version_info >= (3, 8):
270269
def get_coro(self) -> Generator[_TaskYieldType, None, _T] | Awaitable[_T]: ...
271270
def get_name(self) -> str: ...

stdlib/asyncio/windows_events.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ if sys.platform == "win32":
4141
) -> list[PipeServer]: ...
4242
class IocpProactor:
4343
def __init__(self, concurrency: int = ...) -> None: ...
44-
def __repr__(self) -> str: ...
4544
def __del__(self) -> None: ...
4645
def set_loop(self, loop: events.AbstractEventLoop) -> None: ...
4746
def select(self, timeout: int | None = ...) -> list[futures.Future[Any]]: ...

stdlib/asyncio/windows_utils.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ if sys.platform == "win32":
1616
def pipe(*, duplex: bool = ..., overlapped: tuple[bool, bool] = ..., bufsize: int = ...) -> tuple[int, int]: ...
1717
class PipeHandle:
1818
def __init__(self, handle: int) -> None: ...
19-
def __repr__(self) -> str: ...
2019
if sys.version_info >= (3, 8):
2120
def __del__(self, _warn: _WarnFunction = ...) -> None: ...
2221
else:

stdlib/builtins.pyi

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ class int:
261261
def __le__(self, __x: int) -> bool: ...
262262
def __gt__(self, __x: int) -> bool: ...
263263
def __ge__(self, __x: int) -> bool: ...
264-
def __str__(self) -> str: ...
265264
def __float__(self) -> float: ...
266265
def __int__(self) -> int: ...
267266
def __abs__(self) -> int: ...
@@ -319,7 +318,6 @@ class float:
319318
def __ge__(self, __x: float) -> bool: ...
320319
def __neg__(self) -> float: ...
321320
def __pos__(self) -> float: ...
322-
def __str__(self) -> str: ...
323321
def __int__(self) -> int: ...
324322
def __float__(self) -> float: ...
325323
def __abs__(self) -> float: ...
@@ -350,7 +348,6 @@ class complex:
350348
def __ne__(self, __x: object) -> bool: ...
351349
def __neg__(self) -> complex: ...
352350
def __pos__(self) -> complex: ...
353-
def __str__(self) -> str: ...
354351
def __abs__(self) -> float: ...
355352
def __hash__(self) -> int: ...
356353
def __bool__(self) -> bool: ...
@@ -441,9 +438,7 @@ class str(Sequence[str]):
441438
def __mod__(self, __x: Any) -> str: ...
442439
def __mul__(self, __n: SupportsIndex) -> str: ...
443440
def __ne__(self, __x: object) -> bool: ...
444-
def __repr__(self) -> str: ...
445441
def __rmul__(self, n: SupportsIndex) -> str: ...
446-
def __str__(self) -> str: ...
447442
def __getnewargs__(self) -> tuple[str]: ...
448443

449444
class bytes(ByteString):
@@ -525,8 +520,6 @@ class bytes(ByteString):
525520
def maketrans(__frm: bytes, __to: bytes) -> bytes: ...
526521
def __len__(self) -> int: ...
527522
def __iter__(self) -> Iterator[int]: ...
528-
def __str__(self) -> str: ...
529-
def __repr__(self) -> str: ...
530523
def __hash__(self) -> int: ...
531524
@overload
532525
def __getitem__(self, __i: SupportsIndex) -> int: ...
@@ -629,8 +622,6 @@ class bytearray(MutableSequence[int], ByteString):
629622
def maketrans(__frm: bytes, __to: bytes) -> bytes: ...
630623
def __len__(self) -> int: ...
631624
def __iter__(self) -> Iterator[int]: ...
632-
def __str__(self) -> str: ...
633-
def __repr__(self) -> str: ...
634625
__hash__: None # type: ignore[assignment]
635626
@overload
636627
def __getitem__(self, __i: SupportsIndex) -> int: ...
@@ -807,7 +798,6 @@ class list(MutableSequence[_T], Generic[_T]):
807798
def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> None: ...
808799
def __len__(self) -> int: ...
809800
def __iter__(self) -> Iterator[_T]: ...
810-
def __str__(self) -> str: ...
811801
__hash__: None # type: ignore[assignment]
812802
@overload
813803
def __getitem__(self, __i: SupportsIndex) -> _T: ...
@@ -867,7 +857,6 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
867857
def __iter__(self) -> Iterator[_KT]: ...
868858
if sys.version_info >= (3, 8):
869859
def __reversed__(self) -> Iterator[_KT]: ...
870-
def __str__(self) -> str: ...
871860
__hash__: None # type: ignore[assignment]
872861
if sys.version_info >= (3, 9):
873862
def __class_getitem__(cls, __item: Any) -> GenericAlias: ...
@@ -895,7 +884,6 @@ class set(MutableSet[_T], Generic[_T]):
895884
def __len__(self) -> int: ...
896885
def __contains__(self, __o: object) -> bool: ...
897886
def __iter__(self) -> Iterator[_T]: ...
898-
def __str__(self) -> str: ...
899887
def __and__(self, __s: AbstractSet[object]) -> set[_T]: ...
900888
def __iand__(self, __s: AbstractSet[object]) -> set[_T]: ...
901889
def __or__(self, __s: AbstractSet[_S]) -> set[_T | _S]: ...
@@ -925,7 +913,6 @@ class frozenset(AbstractSet[_T_co], Generic[_T_co]):
925913
def __len__(self) -> int: ...
926914
def __contains__(self, __o: object) -> bool: ...
927915
def __iter__(self) -> Iterator[_T_co]: ...
928-
def __str__(self) -> str: ...
929916
def __and__(self, __s: AbstractSet[_T_co]) -> frozenset[_T_co]: ...
930917
def __or__(self, __s: AbstractSet[_S]) -> frozenset[_T_co | _S]: ...
931918
def __sub__(self, __s: AbstractSet[_T_co]) -> frozenset[_T_co]: ...
@@ -965,7 +952,6 @@ class range(Sequence[int]):
965952
def __getitem__(self, __i: SupportsIndex) -> int: ...
966953
@overload
967954
def __getitem__(self, __s: slice) -> range: ...
968-
def __repr__(self) -> str: ...
969955
def __reversed__(self) -> Iterator[int]: ...
970956

971957
class property:
@@ -1526,8 +1512,6 @@ class BaseException:
15261512
if sys.version_info >= (3, 11):
15271513
__note__: str | None
15281514
def __init__(self, *args: object) -> None: ...
1529-
def __str__(self) -> str: ...
1530-
def __repr__(self) -> str: ...
15311515
def with_traceback(self: _TBE, __tb: TracebackType | None) -> _TBE: ...
15321516

15331517
class GeneratorExit(BaseException): ...

stdlib/calendar.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,9 @@ _LocaleType = tuple[Optional[str], Optional[str]]
3535

3636
class IllegalMonthError(ValueError):
3737
def __init__(self, month: int) -> None: ...
38-
def __str__(self) -> str: ...
3938

4039
class IllegalWeekdayError(ValueError):
4140
def __init__(self, weekday: int) -> None: ...
42-
def __str__(self) -> str: ...
4341

4442
def isleap(year: int) -> bool: ...
4543
def leapdays(y1: int, y2: int) -> int: ...

stdlib/cgi.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ class MiniFieldStorage:
5353
name: Any
5454
value: Any
5555
def __init__(self, name: Any, value: Any) -> None: ...
56-
def __repr__(self) -> str: ...
5756

5857
_list = list
5958

@@ -96,7 +95,6 @@ class FieldStorage:
9695
) -> None: ...
9796
def __enter__(self: _T) -> _T: ...
9897
def __exit__(self, *args: Any) -> None: ...
99-
def __repr__(self) -> str: ...
10098
def __iter__(self) -> Iterator[str]: ...
10199
def __getitem__(self, key: str) -> Any: ...
102100
def getvalue(self, key: str, default: Any = ...) -> Any: ...

stdlib/collections/__init__.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ class deque(MutableSequence[_T], Generic[_T]):
200200
def rotate(self, __n: int = ...) -> None: ...
201201
def __copy__(self: _S) -> _S: ...
202202
def __len__(self) -> int: ...
203-
def __str__(self) -> str: ...
204203
# These methods of deque don't take slices, unlike MutableSequence, hence the type: ignores
205204
def __getitem__(self, __index: SupportsIndex) -> _T: ... # type: ignore[override]
206205
def __setitem__(self, __i: SupportsIndex, __x: _T) -> None: ... # type: ignore[override]

stdlib/concurrent/futures/process.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ _MAX_WINDOWS_WORKERS: int
3131
class _RemoteTraceback(Exception):
3232
tb: str
3333
def __init__(self, tb: TracebackType) -> None: ...
34-
def __str__(self) -> str: ...
3534

3635
class _ExceptionWithTraceback:
3736
exc: BaseException

stdlib/decimal.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ class Decimal:
8080
def __rmul__(self, __other: _Decimal) -> Decimal: ...
8181
def __rsub__(self, __other: _Decimal) -> Decimal: ...
8282
def __rtruediv__(self, __other: _Decimal) -> Decimal: ...
83-
def __str__(self) -> str: ...
8483
def __sub__(self, __other: _Decimal) -> Decimal: ...
8584
def __truediv__(self, __other: _Decimal) -> Decimal: ...
8685
def remainder_near(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...

stdlib/dis.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class Bytecode:
3838
first_line: int
3939
def __init__(self, x: _HaveCodeOrStringType, *, first_line: int | None = ..., current_offset: int | None = ...) -> None: ...
4040
def __iter__(self) -> Iterator[Instruction]: ...
41-
def __repr__(self) -> str: ...
4241
def info(self) -> str: ...
4342
def dis(self) -> str: ...
4443
@classmethod

stdlib/email/charset.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class Charset:
1717
def header_encode(self, string: str) -> str: ...
1818
def header_encode_lines(self, string: str, maxlengths: Iterator[int]) -> list[str]: ...
1919
def body_encode(self, string: str) -> str: ...
20-
def __str__(self) -> str: ...
2120
def __eq__(self, other: Any) -> bool: ...
2221
def __ne__(self, other: Any) -> bool: ...
2322

stdlib/email/header.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class Header:
1313
) -> None: ...
1414
def append(self, s: bytes | str, charset: Charset | str | None = ..., errors: str = ...) -> None: ...
1515
def encode(self, splitchars: str = ..., maxlinelen: int | None = ..., linesep: str = ...) -> str: ...
16-
def __str__(self) -> str: ...
1716
def __eq__(self, other: Any) -> bool: ...
1817
def __ne__(self, other: Any) -> bool: ...
1918

stdlib/email/headerregistry.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,10 @@ class Address:
159159
def __init__(
160160
self, display_name: str = ..., username: str | None = ..., domain: str | None = ..., addr_spec: str | None = ...
161161
) -> None: ...
162-
def __str__(self) -> str: ...
163162

164163
class Group:
165164
@property
166165
def display_name(self) -> str | None: ...
167166
@property
168167
def addresses(self) -> tuple[Address, ...]: ...
169168
def __init__(self, display_name: str | None = ..., addresses: Iterable[Address] | None = ...) -> None: ...
170-
def __str__(self) -> str: ...

stdlib/email/message.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class Message:
1717
preamble: str | None
1818
epilogue: str | None
1919
defects: list[MessageDefect]
20-
def __str__(self) -> str: ...
2120
def is_multipart(self) -> bool: ...
2221
def set_unixfrom(self, unixfrom: str) -> None: ...
2322
def get_unixfrom(self) -> str | None: ...

stdlib/enum.pyi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ class Enum(metaclass=EnumMeta):
113113
@staticmethod
114114
def _generate_next_value_(name: str, start: int, count: int, last_values: list[Any]) -> Any: ...
115115
def __new__(cls: type[_T], value: object) -> _T: ...
116-
def __repr__(self) -> str: ...
117-
def __str__(self) -> str: ...
118116
def __dir__(self) -> list[str]: ...
119117
def __format__(self, format_spec: str) -> str: ...
120118
def __hash__(self) -> Any: ...
@@ -159,8 +157,6 @@ class Flag(Enum):
159157
@types.DynamicClassAttribute
160158
def value(self) -> int: ...
161159
def __contains__(self: _T, other: _T) -> bool: ...
162-
def __repr__(self) -> str: ...
163-
def __str__(self) -> str: ...
164160
def __bool__(self) -> bool: ...
165161
def __or__(self: _T, other: _T) -> _T: ...
166162
def __and__(self: _T, other: _T) -> _T: ...

stdlib/http/cookiejar.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ class CookieJar(Iterable[Cookie]):
2727
def clear_expired_cookies(self) -> None: ... # undocumented
2828
def __iter__(self) -> Iterator[Cookie]: ...
2929
def __len__(self) -> int: ...
30-
def __repr__(self) -> str: ...
31-
def __str__(self) -> str: ...
3230

3331
class FileCookieJar(CookieJar):
3432
filename: str

stdlib/modulefinder.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def ReplacePackage(oldname: str, newname: str) -> None: ...
1919

2020
class Module: # undocumented
2121
def __init__(self, name: str, file: str | None = ..., path: str | None = ...) -> None: ...
22-
def __repr__(self) -> str: ...
2322

2423
class ModuleFinder:
2524

stdlib/msilib/__init__.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ if sys.platform == "win32":
9595

9696
name: str
9797
def __init__(self, fname: str) -> None: ...
98-
def __repr__(self) -> str: ...
9998
class Feature:
10099

101100
id: str

stdlib/multiprocessing/managers.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class Token:
3232
address: tuple[str | bytes, int]
3333
id: str | bytes | int | None
3434
def __init__(self, typeid: bytes | str | None, address: tuple[str | bytes, int], id: str | bytes | int | None) -> None: ...
35-
def __repr__(self) -> str: ...
3635
def __getstate__(self) -> tuple[str | bytes | None, tuple[str | bytes, int], str | bytes | int | None]: ...
3736
def __setstate__(self, state: tuple[str | bytes | None, tuple[str | bytes, int], str | bytes | int | None]) -> None: ...
3837

stdlib/typing.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,6 @@ if sys.version_info >= (3, 7):
738738
def _evaluate(self, globalns: dict[str, Any] | None, localns: dict[str, Any] | None) -> Any | None: ...
739739
def __eq__(self, other: Any) -> bool: ...
740740
def __hash__(self) -> int: ...
741-
def __repr__(self) -> str: ...
742741
if sys.version_info >= (3, 11):
743742
def __or__(self, other: Any) -> _SpecialForm: ...
744743
def __ror__(self, other: Any) -> _SpecialForm: ...

stdlib/weakref.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]):
3333
def __delitem__(self, v: _KT) -> None: ...
3434
def __contains__(self, o: object) -> bool: ...
3535
def __iter__(self) -> Iterator[_KT]: ...
36-
def __str__(self) -> str: ...
3736
def copy(self) -> WeakValueDictionary[_KT, _VT]: ...
3837
# These are incompatible with Mapping
3938
def keys(self) -> Iterator[_KT]: ... # type: ignore[override]
@@ -64,7 +63,6 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]):
6463
def __delitem__(self, v: _KT) -> None: ...
6564
def __contains__(self, o: object) -> bool: ...
6665
def __iter__(self) -> Iterator[_KT]: ...
67-
def __str__(self) -> str: ...
6866
def copy(self) -> WeakKeyDictionary[_KT, _VT]: ...
6967
# These are incompatible with Mapping
7068
def keys(self) -> Iterator[_KT]: ... # type: ignore[override]

stdlib/zipfile.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ class ZipExtFile(io.BufferedIOBase):
9898
) -> None: ...
9999
def read(self, n: int | None = ...) -> bytes: ...
100100
def readline(self, limit: int = ...) -> bytes: ... # type: ignore[override]
101-
def __repr__(self) -> str: ...
102101
def peek(self, n: int = ...) -> bytes: ...
103102
def read1(self, n: int | None) -> bytes: ... # type: ignore[override]
104103
if sys.version_info >= (3, 7):

0 commit comments

Comments
 (0)