Skip to content

Commit a376da8

Browse files
authored
Remove duplicate definitions (#8483)
1 parent 103c2f3 commit a376da8

20 files changed

+4
-101
lines changed

stdlib/_compression.pyi

-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ class DecompressReader(RawIOBase):
2020
trailing_error: type[Exception] | tuple[type[Exception], ...] = ...,
2121
**decomp_args: Any,
2222
) -> None: ...
23-
def readable(self) -> bool: ...
24-
def close(self) -> None: ...
25-
def seekable(self) -> bool: ...
2623
def readinto(self, b: WriteableBuffer) -> int: ...
2724
def read(self, size: int = ...) -> bytes: ...
2825
def seek(self, offset: int, whence: int = ...) -> int: ...
29-
def tell(self) -> int: ...

stdlib/_decimal.pyi

-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ class Context:
201201
) -> None: ...
202202
# __setattr__() only allows to set a specific set of attributes,
203203
# already defined above.
204-
def __delattr__(self, __name: str) -> None: ...
205204
def __reduce__(self: Self) -> tuple[type[Self], tuple[Any, ...]]: ...
206205
def clear_flags(self) -> None: ...
207206
def clear_traps(self) -> None: ...

stdlib/_dummy_thread.pyi

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ def stack_size(size: int | None = ...) -> int: ...
1515

1616
class LockType:
1717
locked_status: bool
18-
def __init__(self) -> None: ...
1918
def acquire(self, waitflag: bool | None = ..., timeout: int = ...) -> bool: ...
2019
def __enter__(self, waitflag: bool | None = ..., timeout: int = ...) -> bool: ...
2120
def __exit__(self, typ: type[BaseException] | None, val: BaseException | None, tb: TracebackType | None) -> None: ...

stdlib/_markupbase.pyi

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import sys
22
from typing import Any
33

44
class ParserBase:
5-
def __init__(self) -> None: ...
65
def reset(self) -> None: ...
76
def getpos(self) -> tuple[int, int]: ...
87
def unknown_decl(self, data: str) -> None: ...

stdlib/_threading_local.pyi

-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ _LocalDict: TypeAlias = dict[Any, Any]
88
class _localimpl:
99
key: str
1010
dicts: dict[int, tuple[ReferenceType[Any], _LocalDict]]
11-
def __init__(self) -> None: ...
1211
def get_dict(self) -> _LocalDict: ...
1312
def create_dict(self) -> _LocalDict: ...
1413

1514
class local:
1615
def __getattribute__(self, name: str) -> Any: ...
1716
def __setattr__(self, name: str, value: Any) -> None: ...
18-
def __delattr__(self, name: str) -> None: ...

stdlib/_weakrefset.pyi

-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ class WeakSet(MutableSet[_T], Generic[_T]):
1717
@overload
1818
def __init__(self, data: Iterable[_T]) -> None: ...
1919
def add(self, item: _T) -> None: ...
20-
def clear(self) -> None: ...
2120
def discard(self, item: _T) -> None: ...
2221
def copy(self: Self) -> Self: ...
23-
def pop(self) -> _T: ...
2422
def remove(self, item: _T) -> None: ...
2523
def update(self, other: Iterable[_T]) -> None: ...
2624
def __contains__(self, item: object) -> bool: ...
@@ -41,7 +39,6 @@ class WeakSet(MutableSet[_T], Generic[_T]):
4139
def issuperset(self, other: Iterable[_T]) -> bool: ...
4240
def __ge__(self, other: Iterable[_T]) -> bool: ...
4341
def __gt__(self, other: Iterable[_T]) -> bool: ...
44-
def __eq__(self, other: object) -> bool: ...
4542
def symmetric_difference(self, other: Iterable[_S]) -> WeakSet[_S | _T]: ...
4643
def __xor__(self, other: Iterable[_S]) -> WeakSet[_S | _T]: ...
4744
def symmetric_difference_update(self, other: Iterable[_T]) -> None: ...

stdlib/argparse.pyi

-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ class Namespace(_AttributeHolder):
330330
def __getattr__(self, name: str) -> Any: ...
331331
def __setattr__(self, __name: str, __value: Any) -> None: ...
332332
def __contains__(self, key: str) -> bool: ...
333-
def __eq__(self, other: object) -> bool: ...
334333

335334
class FileType:
336335
# undocumented

stdlib/array.pyi

-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class array(MutableSequence[_T], Generic[_T]):
4747
def insert(self, __i: int, __v: _T) -> None: ...
4848
def pop(self, __i: int = ...) -> _T: ...
4949
def remove(self, __v: _T) -> None: ...
50-
def reverse(self) -> None: ...
5150
def tobytes(self) -> bytes: ...
5251
def tofile(self, __f: SupportsWrite[bytes]) -> None: ...
5352
def tolist(self) -> list[_T]: ...
@@ -56,7 +55,6 @@ class array(MutableSequence[_T], Generic[_T]):
5655
def fromstring(self, __buffer: bytes) -> None: ...
5756
def tostring(self) -> bytes: ...
5857

59-
def __contains__(self, __key: object) -> bool: ...
6058
def __len__(self) -> int: ...
6159
@overload
6260
def __getitem__(self, __i: SupportsIndex) -> _T: ...

stdlib/asynchat.pyi

-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import asyncore
2-
import socket
32
from abc import abstractmethod
43

54
class simple_producer:
@@ -9,20 +8,14 @@ class simple_producer:
98
class async_chat(asyncore.dispatcher):
109
ac_in_buffer_size: int
1110
ac_out_buffer_size: int
12-
def __init__(self, sock: socket.socket | None = ..., map: asyncore._MapType | None = ...) -> None: ...
1311
@abstractmethod
1412
def collect_incoming_data(self, data: bytes) -> None: ...
1513
@abstractmethod
1614
def found_terminator(self) -> None: ...
1715
def set_terminator(self, term: bytes | int | None) -> None: ...
1816
def get_terminator(self) -> bytes | int | None: ...
19-
def handle_read(self) -> None: ...
20-
def handle_write(self) -> None: ...
21-
def handle_close(self) -> None: ...
2217
def push(self, data: bytes) -> None: ...
2318
def push_with_producer(self, producer: simple_producer) -> None: ...
24-
def readable(self) -> bool: ...
25-
def writable(self) -> bool: ...
2619
def close_when_done(self) -> None: ...
2720
def initiate_send(self) -> None: ...
2821
def discard_buffers(self) -> None: ...

stdlib/asyncio/base_subprocess.pyi

+1-13
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,10 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
4444
bufsize: int,
4545
**kwargs: Any,
4646
) -> None: ... # undocumented
47-
def set_protocol(self, protocol: protocols.BaseProtocol) -> None: ...
48-
def get_protocol(self) -> protocols.BaseProtocol: ...
49-
def is_closing(self) -> bool: ...
50-
def close(self) -> None: ...
5147
def get_pid(self) -> int | None: ... # type: ignore[override]
52-
def get_returncode(self) -> int | None: ...
5348
def get_pipe_transport(self, fd: int) -> _File: ... # type: ignore[override]
5449
def _check_proc(self) -> None: ... # undocumented
5550
def send_signal(self, signal: int) -> None: ... # type: ignore[override]
56-
def terminate(self) -> None: ...
57-
def kill(self) -> None: ...
5851
async def _connect_pipes(self, waiter: futures.Future[Any] | None) -> None: ... # undocumented
5952
def _call(self, cb: Callable[..., object], *data: Any) -> None: ... # undocumented
6053
def _pipe_connection_lost(self, fd: int, exc: BaseException | None) -> None: ... # undocumented
@@ -66,10 +59,5 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
6659

6760
class WriteSubprocessPipeProto(protocols.BaseProtocol): # undocumented
6861
def __init__(self, proc: BaseSubprocessTransport, fd: int) -> None: ...
69-
def connection_made(self, transport: transports.BaseTransport) -> None: ...
70-
def connection_lost(self, exc: BaseException | None) -> None: ...
71-
def pause_writing(self) -> None: ...
72-
def resume_writing(self) -> None: ...
7362

74-
class ReadSubprocessPipeProto(WriteSubprocessPipeProto, protocols.Protocol): # undocumented
75-
def data_received(self, data: bytes) -> None: ...
63+
class ReadSubprocessPipeProto(WriteSubprocessPipeProto, protocols.Protocol): ... # undocumented

stdlib/asyncio/events.pyi

-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ class TimerHandle(Handle):
9191
def __le__(self, other: TimerHandle) -> bool: ...
9292
def __gt__(self, other: TimerHandle) -> bool: ...
9393
def __ge__(self, other: TimerHandle) -> bool: ...
94-
def __eq__(self, other: object) -> bool: ...
9594

9695
class AbstractServer:
9796
@abstractmethod
@@ -612,7 +611,6 @@ class AbstractEventLoopPolicy:
612611
def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ...
613612

614613
class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy, metaclass=ABCMeta):
615-
def __init__(self) -> None: ...
616614
def get_event_loop(self) -> AbstractEventLoop: ...
617615
def set_event_loop(self, loop: AbstractEventLoop | None) -> None: ...
618616
def new_event_loop(self) -> AbstractEventLoop: ...

stdlib/asyncio/locks.pyi

+1-5
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,7 @@ class Semaphore(_ContextManagerMixin):
9292
def release(self) -> None: ...
9393
def _wake_up_next(self) -> None: ...
9494

95-
class BoundedSemaphore(Semaphore):
96-
if sys.version_info >= (3, 11):
97-
def __init__(self, value: int = ...) -> None: ...
98-
else:
99-
def __init__(self, value: int = ..., *, loop: AbstractEventLoop | None = ...) -> None: ...
95+
class BoundedSemaphore(Semaphore): ...
10096

10197
if sys.version_info >= (3, 11):
10298
class _BarrierState(enum.Enum): # undocumented

stdlib/asyncio/proactor_events.pyi

+2-25
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ class _ProactorBasePipeTransport(transports._FlowControlMixin, transports.BaseTr
2929
else:
3030
def __del__(self) -> None: ...
3131

32-
def get_write_buffer_size(self) -> int: ...
33-
3432
class _ProactorReadPipeTransport(_ProactorBasePipeTransport, transports.ReadTransport):
3533
if sys.version_info >= (3, 10):
3634
def __init__(
@@ -54,28 +52,8 @@ class _ProactorReadPipeTransport(_ProactorBasePipeTransport, transports.ReadTran
5452
server: events.AbstractServer | None = ...,
5553
) -> None: ...
5654

57-
class _ProactorBaseWritePipeTransport(_ProactorBasePipeTransport, transports.WriteTransport):
58-
def __init__(
59-
self,
60-
loop: events.AbstractEventLoop,
61-
sock: socket,
62-
protocol: streams.StreamReaderProtocol,
63-
waiter: futures.Future[Any] | None = ...,
64-
extra: Mapping[Any, Any] | None = ...,
65-
server: events.AbstractServer | None = ...,
66-
) -> None: ...
67-
68-
class _ProactorWritePipeTransport(_ProactorBaseWritePipeTransport):
69-
def __init__(
70-
self,
71-
loop: events.AbstractEventLoop,
72-
sock: socket,
73-
protocol: streams.StreamReaderProtocol,
74-
waiter: futures.Future[Any] | None = ...,
75-
extra: Mapping[Any, Any] | None = ...,
76-
server: events.AbstractServer | None = ...,
77-
) -> None: ...
78-
55+
class _ProactorBaseWritePipeTransport(_ProactorBasePipeTransport, transports.WriteTransport): ...
56+
class _ProactorWritePipeTransport(_ProactorBaseWritePipeTransport): ...
7957
class _ProactorDuplexPipeTransport(_ProactorReadPipeTransport, _ProactorBaseWritePipeTransport, transports.Transport): ...
8058

8159
class _ProactorSocketTransport(_ProactorReadPipeTransport, _ProactorBaseWritePipeTransport, transports.Transport):
@@ -92,7 +70,6 @@ class _ProactorSocketTransport(_ProactorReadPipeTransport, _ProactorBaseWritePip
9270
) -> None: ...
9371
def _set_extra(self, sock: socket) -> None: ...
9472
def can_write_eof(self) -> Literal[True]: ...
95-
def write_eof(self) -> None: ...
9673

9774
class BaseProactorEventLoop(base_events.BaseEventLoop):
9875
def __init__(self, proactor: Any) -> None: ...

stdlib/asyncio/sslproto.pyi

-15
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,10 @@ class _SSLProtocolTransport(transports._FlowControlMixin, transports.Transport):
7272
_closed: bool
7373
def __init__(self, loop: events.AbstractEventLoop, ssl_protocol: SSLProtocol) -> None: ...
7474
def get_extra_info(self, name: str, default: Any | None = ...) -> dict[str, Any]: ...
75-
def set_protocol(self, protocol: protocols.BaseProtocol) -> None: ...
76-
def get_protocol(self) -> protocols.BaseProtocol: ...
77-
def is_closing(self) -> bool: ...
78-
def close(self) -> None: ...
79-
def is_reading(self) -> bool: ...
80-
def pause_reading(self) -> None: ...
81-
def resume_reading(self) -> None: ...
82-
def set_write_buffer_limits(self, high: int | None = ..., low: int | None = ...) -> None: ...
83-
def get_write_buffer_size(self) -> int: ...
8475
@property
8576
def _protocol_paused(self) -> bool: ...
8677
def write(self, data: bytes) -> None: ...
8778
def can_write_eof(self) -> Literal[False]: ...
88-
def abort(self) -> None: ...
8979
if sys.version_info >= (3, 11):
9080
def get_write_buffer_limits(self) -> tuple[int, int]: ...
9181
def get_read_buffer_limits(self) -> tuple[int, int]: ...
@@ -149,10 +139,7 @@ class SSLProtocol(_SSLProtocolBase):
149139

150140
def _set_app_protocol(self, app_protocol: protocols.BaseProtocol) -> None: ...
151141
def _wakeup_waiter(self, exc: BaseException | None = ...) -> None: ...
152-
def connection_made(self, transport: transports.BaseTransport) -> None: ...
153142
def connection_lost(self, exc: BaseException | None) -> None: ...
154-
def pause_writing(self) -> None: ...
155-
def resume_writing(self) -> None: ...
156143
def eof_received(self) -> None: ...
157144
def _get_extra_info(self, name: str, default: Any | None = ...) -> Any: ...
158145
def _start_shutdown(self) -> None: ...
@@ -167,9 +154,7 @@ class SSLProtocol(_SSLProtocolBase):
167154
def _fatal_error(self, exc: BaseException, message: str = ...) -> None: ...
168155
def _abort(self) -> None: ...
169156
if sys.version_info >= (3, 11):
170-
def buffer_updated(self, nbytes: int) -> None: ...
171157
def get_buffer(self, n: int) -> memoryview: ...
172158
else:
173159
def _finalize(self) -> None: ...
174160
def _process_write_backlog(self) -> None: ...
175-
def data_received(self, data: bytes) -> None: ...

stdlib/asyncio/streams.pyi

-4
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,6 @@ class StreamReaderProtocol(FlowControlMixin, protocols.Protocol):
128128
client_connected_cb: _ClientConnectedCallback | None = ...,
129129
loop: events.AbstractEventLoop | None = ...,
130130
) -> None: ...
131-
def connection_made(self, transport: transports.BaseTransport) -> None: ...
132-
def connection_lost(self, exc: Exception | None) -> None: ...
133-
def data_received(self, data: bytes) -> None: ...
134-
def eof_received(self) -> bool: ...
135131

136132
class StreamWriter:
137133
def __init__(

stdlib/asyncio/subprocess.pyi

-3
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ class SubprocessStreamProtocol(streams.FlowControlMixin, protocols.SubprocessPro
2222
stdout: streams.StreamReader | None
2323
stderr: streams.StreamReader | None
2424
def __init__(self, limit: int, loop: events.AbstractEventLoop) -> None: ...
25-
def connection_made(self, transport: transports.BaseTransport) -> None: ...
2625
def pipe_data_received(self, fd: int, data: bytes | str) -> None: ...
27-
def pipe_connection_lost(self, fd: int, exc: Exception | None) -> None: ...
28-
def process_exited(self) -> None: ...
2926

3027
class Process:
3128
stdin: streams.StreamWriter | None

stdlib/asyncio/tasks.pyi

-4
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,6 @@ class Task(Future[_T], Generic[_T]):
285285

286286
def get_stack(self, *, limit: int | None = ...) -> list[FrameType]: ...
287287
def print_stack(self, *, limit: int | None = ..., file: TextIO | None = ...) -> None: ...
288-
if sys.version_info >= (3, 9):
289-
def cancel(self, msg: Any | None = ...) -> bool: ...
290-
else:
291-
def cancel(self) -> bool: ...
292288
if sys.version_info >= (3, 11):
293289
def cancelling(self) -> int: ...
294290
def uncancel(self) -> int: ...

stdlib/asyncio/transports.pyi

-3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,3 @@ class SubprocessTransport(BaseTransport):
4545

4646
class _FlowControlMixin(Transport):
4747
def __init__(self, extra: Mapping[Any, Any] | None = ..., loop: AbstractEventLoop | None = ...) -> None: ...
48-
def set_write_buffer_limits(self, high: int | None = ..., low: int | None = ...) -> None: ...
49-
def get_write_buffer_size(self) -> int: ...
50-
def get_write_buffer_limits(self) -> tuple[int, int]: ...

stdlib/asyncio/unix_events.pyi

-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ if sys.platform != "win32":
5757
# Doesn't actually have ABCMeta metaclass at runtime, but mypy complains if we don't have it in the stub.
5858
# See discussion in #7412
5959
class BaseChildWatcher(AbstractChildWatcher, metaclass=ABCMeta):
60-
def __init__(self) -> None: ...
6160
def close(self) -> None: ...
6261
if sys.version_info >= (3, 8):
6362
def is_active(self) -> bool: ...
@@ -95,7 +94,6 @@ if sys.platform != "win32":
9594
) -> object: ...
9695

9796
class MultiLoopChildWatcher(AbstractChildWatcher):
98-
def __init__(self) -> None: ...
9997
def is_active(self) -> bool: ...
10098
def close(self) -> None: ...
10199
def __enter__(self: Self) -> Self: ...
@@ -107,7 +105,6 @@ if sys.platform != "win32":
107105
def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
108106

109107
class ThreadedChildWatcher(AbstractChildWatcher):
110-
def __init__(self) -> None: ...
111108
def is_active(self) -> Literal[True]: ...
112109
def close(self) -> None: ...
113110
def __enter__(self: Self) -> Self: ...

stdlib/asyncore.pyi

-2
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ class dispatcher:
6363
def handle_close(self) -> None: ...
6464

6565
class dispatcher_with_send(dispatcher):
66-
def __init__(self, sock: socket | None = ..., map: _MapType | None = ...) -> None: ...
6766
def initiate_send(self) -> None: ...
68-
def handle_write(self) -> None: ...
6967
# incompatible signature:
7068
# def send(self, data: bytes) -> int | None: ...
7169

0 commit comments

Comments
 (0)