Skip to content

Remove empty __init__ methods #8816

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 2 commits into from
Sep 30, 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
3 changes: 0 additions & 3 deletions stdlib/_dummy_threading.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ class Thread:
class _DummyThread(Thread): ...

class Lock:
def __init__(self) -> None: ...
def __enter__(self) -> bool: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
Expand All @@ -96,7 +95,6 @@ class Lock:
def locked(self) -> bool: ...

class _RLock:
def __init__(self) -> None: ...
def __enter__(self) -> bool: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
Expand Down Expand Up @@ -135,7 +133,6 @@ class Semaphore:
class BoundedSemaphore(Semaphore): ...

class Event:
def __init__(self) -> None: ...
def is_set(self) -> bool: ...
def set(self) -> None: ...
def clear(self) -> None: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/asyncio/taskgroups.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ __all__ = ["TaskGroup"]
_T = TypeVar("_T")

class TaskGroup:
def __init__(self) -> None: ...
async def __aenter__(self: Self) -> Self: ...
async def __aexit__(self, et: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None) -> None: ...
def create_task(
Expand Down
1 change: 0 additions & 1 deletion stdlib/asyncio/unix_events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ if sys.platform != "win32":

if sys.version_info >= (3, 9):
class PidfdChildWatcher(AbstractChildWatcher):
def __init__(self) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None
Expand Down
1 change: 0 additions & 1 deletion stdlib/binhex.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ LINELEN: Literal[64]
RUNCHAR: Literal[b"\x90"]

class FInfo:
def __init__(self) -> None: ...
Type: str
Creator: str
Flags: int
Expand Down
2 changes: 0 additions & 2 deletions stdlib/codeop.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ def compile_command(source: str, filename: str = ..., symbol: str = ...) -> Code

class Compile:
flags: int
def __init__(self) -> None: ...
def __call__(self, source: str, filename: str, symbol: str) -> CodeType: ...

class CommandCompiler:
compiler: Compile
def __init__(self) -> None: ...
def __call__(self, source: str, filename: str = ..., symbol: str = ...) -> CodeType | None: ...
3 changes: 0 additions & 3 deletions stdlib/concurrent/futures/_base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ _T = TypeVar("_T")
_P = ParamSpec("_P")

class Future(Generic[_T]):
def __init__(self) -> None: ...
def cancel(self) -> bool: ...
def cancelled(self) -> bool: ...
def running(self) -> bool: ...
Expand Down Expand Up @@ -90,14 +89,12 @@ def wait(fs: Iterable[Future[_T]], timeout: float | None = ..., return_when: str
class _Waiter:
event: threading.Event
finished_futures: list[Future[Any]]
def __init__(self) -> None: ...
def add_result(self, future: Future[Any]) -> None: ...
def add_exception(self, future: Future[Any]) -> None: ...
def add_cancelled(self, future: Future[Any]) -> None: ...

class _AsCompletedWaiter(_Waiter):
lock: threading.Lock
def __init__(self) -> None: ...

class _FirstCompletedWaiter(_Waiter): ...

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 @@ -19,7 +19,6 @@ class _ThreadWakeup:
_closed: bool
_reader: Connection
_writer: Connection
def __init__(self) -> None: ...
def close(self) -> None: ...
def wakeup(self) -> None: ...
def clear(self) -> None: ...
Expand Down
2 changes: 0 additions & 2 deletions stdlib/contextlib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ class redirect_stderr(_RedirectStream[_T_io]): ...
# In reality this is a subclass of `AbstractContextManager`;
# see #7961 for why we don't do that in the stub
class ExitStack(metaclass=abc.ABCMeta):
def __init__(self) -> None: ...
def enter_context(self, cm: AbstractContextManager[_T]) -> _T: ...
def push(self, exit: _CM_EF) -> _CM_EF: ...
def callback(self, __callback: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]: ...
Expand All @@ -156,7 +155,6 @@ _ACM_EF = TypeVar("_ACM_EF", bound=AbstractAsyncContextManager[Any] | _ExitCoroF
# In reality this is a subclass of `AbstractAsyncContextManager`;
# see #7961 for why we don't do that in the stub
class AsyncExitStack(metaclass=abc.ABCMeta):
def __init__(self) -> None: ...
def enter_context(self, cm: AbstractContextManager[_T]) -> _T: ...
async def enter_async_context(self, cm: AbstractAsyncContextManager[_T]) -> _T: ...
def push(self, exit: _CM_EF) -> _CM_EF: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/csv.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,5 @@ class DictWriter(Generic[_T]):

class Sniffer:
preferred: list[str]
def __init__(self) -> None: ...
def sniff(self, sample: str, delimiters: str | None = ...) -> type[Dialect]: ...
def has_header(self, sample: str) -> bool: ...
1 change: 0 additions & 1 deletion stdlib/email/contentmanager.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ from email.message import Message
from typing import Any

class ContentManager:
def __init__(self) -> None: ...
def get_content(self, msg: Message, *args: Any, **kw: Any) -> Any: ...
def set_content(self, msg: Message, obj: Any, *args: Any, **kw: Any) -> Any: ...
def add_get_handler(self, key: str, handler: Callable[..., Any]) -> None: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/formatter.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class AbstractFormatter:
def assert_line_data(self, flag: int = ...) -> None: ...

class NullWriter:
def __init__(self) -> None: ...
def flush(self) -> None: ...
def new_alignment(self, align: str | None) -> None: ...
def new_font(self, font: _FontType) -> None: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/lib2to3/pgen2/grammar.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class Grammar:
tokens: dict[int, int]
symbol2label: dict[str, int]
start: int
def __init__(self) -> None: ...
def dump(self, filename: StrPath) -> None: ...
def load(self, filename: StrPath) -> None: ...
def copy(self: Self) -> Self: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/lib2to3/pgen2/pgen.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class ParserGenerator:

class NFAState:
arcs: list[tuple[str | None, NFAState]]
def __init__(self) -> None: ...
def addarc(self, next: NFAState, label: str | None = ...) -> None: ...

class DFAState:
Expand Down
1 change: 0 additions & 1 deletion stdlib/lib2to3/pgen2/tokenize.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class Untokenizer:
tokens: list[str]
prev_row: int
prev_col: int
def __init__(self) -> None: ...
def add_whitespace(self, start: _Coord) -> None: ...
def untokenize(self, iterable: Iterable[_TokenInfo]) -> str: ...
def compat(self, token: tuple[int, str], iterable: Iterable[_TokenInfo]) -> None: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/logging/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ _nameToLevel: dict[str, int]

class Filterer:
filters: list[Filter]
def __init__(self) -> None: ...
def addFilter(self, filter: _FilterType) -> None: ...
def removeFilter(self, filter: _FilterType) -> None: ...
def filter(self, record: LogRecord) -> bool: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/multiprocessing/forkserver.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ MAXFDS_TO_SEND: int
SIGNED_STRUCT: Struct

class ForkServer:
def __init__(self) -> None: ...
def set_forkserver_preload(self, modules_names: list[str]) -> None: ...
def get_inherited_fds(self) -> list[int] | None: ...
def connect_to_new_process(self, fds: Sequence[int]) -> tuple[int, int]: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/multiprocessing/resource_tracker.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ from collections.abc import Sized
__all__ = ["ensure_running", "register", "unregister"]

class ResourceTracker:
def __init__(self) -> None: ...
def getfd(self) -> int | None: ...
def ensure_running(self) -> None: ...
def register(self, name: Sized, rtype: Incomplete) -> None: ...
Expand Down
4 changes: 1 addition & 3 deletions stdlib/multiprocessing/util.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,10 @@ def is_exiting() -> bool: ...
class ForkAwareThreadLock:
acquire: Callable[[bool, float], bool]
release: Callable[[], None]
def __init__(self) -> None: ...
def __enter__(self) -> bool: ...
def __exit__(self, *args: object) -> None: ...

class ForkAwareLocal(threading.local):
def __init__(self) -> None: ...
class ForkAwareLocal(threading.local): ...

MAXFD: int

Expand Down
1 change: 0 additions & 1 deletion stdlib/pipes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import os
__all__ = ["Template"]

class Template:
def __init__(self) -> None: ...
def reset(self) -> None: ...
def clone(self) -> Template: ...
def debug(self, flag: bool) -> None: ...
Expand Down
2 changes: 0 additions & 2 deletions stdlib/pydoc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class Doc:
def getdocloc(self, object: object, basedir: str = ...) -> str | None: ...

class HTMLRepr(Repr):
def __init__(self) -> None: ...
def escape(self, text: str) -> str: ...
def repr(self, object: object) -> str: ...
def repr1(self, x: object, level: complex) -> str: ...
Expand Down Expand Up @@ -148,7 +147,6 @@ class HTMLDoc(Doc):
def filelink(self, url: str, path: str) -> str: ...

class TextRepr(Repr):
def __init__(self) -> None: ...
def repr1(self, x: object, level: complex) -> str: ...
def repr_string(self, x: str, level: complex) -> str: ...
def repr_str(self, x: str, level: complex) -> str: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/reprlib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class Repr:
maxlong: int
maxstring: int
maxother: int
def __init__(self) -> None: ...
def repr(self, x: Any) -> str: ...
def repr1(self, x: Any, level: int) -> str: ...
def repr_tuple(self, x: tuple[Any, ...], level: int) -> str: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/select.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ if sys.platform != "win32":
POLLWRNORM: int

class poll:
def __init__(self) -> None: ...
def register(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ...
def modify(self, fd: FileDescriptorLike, eventmask: int) -> None: ...
def unregister(self, fd: FileDescriptorLike) -> None: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/sre_parse.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class _State:
groupdict: dict[str, int]
groupwidths: list[int | None]
lookbehindgroups: int | None
def __init__(self) -> None: ...
@property
def groups(self) -> int: ...
def opengroup(self, name: str | None = ...) -> int: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/symtable.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,5 @@ class Symbol:
def get_namespace(self) -> SymbolTable: ...

class SymbolTableFactory:
def __init__(self) -> None: ...
def new(self, table: Any, filename: str) -> SymbolTable: ...
def __call__(self, table: Any, filename: str) -> SymbolTable: ...
3 changes: 0 additions & 3 deletions stdlib/threading.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ class _DummyThread(Thread):
def __init__(self) -> None: ...

class Lock:
def __init__(self) -> None: ...
def __enter__(self) -> bool: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
Expand All @@ -112,7 +111,6 @@ class Lock:
def locked(self) -> bool: ...

class _RLock:
def __init__(self) -> None: ...
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
def release(self) -> None: ...
__enter__ = acquire
Expand Down Expand Up @@ -148,7 +146,6 @@ class Semaphore:
class BoundedSemaphore(Semaphore): ...

class Event:
def __init__(self) -> None: ...
def is_set(self) -> bool: ...
def isSet(self) -> bool: ... # deprecated alias for is_set()
def set(self) -> None: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/tokenize.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ class Untokenizer:
prev_row: int
prev_col: int
encoding: str | None
def __init__(self) -> None: ...
def add_whitespace(self, start: _Position) -> None: ...
def untokenize(self, iterable: Iterable[_Token]) -> str: ...
def compat(self, token: Sequence[int | str], iterable: Iterable[_Token]) -> None: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/traceback.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ def walk_tb(tb: TracebackType | None) -> Iterator[tuple[FrameType, int]]: ...

if sys.version_info >= (3, 11):
class _ExceptionPrintContext:
def __init__(self) -> None: ...
def indent(self) -> str: ...
def emit(self, text_gen: str | Iterable[str], margin_char: str | None = ...) -> Generator[str, None, None]: ...

Expand Down
1 change: 0 additions & 1 deletion stdlib/unittest/mock.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class _SentinelObject:
def __init__(self, name: Any) -> None: ...

class _Sentinel:
def __init__(self) -> None: ...
def __getattr__(self, name: str) -> Any: ...

sentinel: Any
Expand Down
1 change: 0 additions & 1 deletion stdlib/xdrlib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class Error(Exception):
class ConversionError(Error): ...

class Packer:
def __init__(self) -> None: ...
def reset(self) -> None: ...
def get_buffer(self) -> bytes: ...
def get_buf(self) -> bytes: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/xml/dom/xmlbuilder.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class DOMBuilder:
ACTION_APPEND_AS_CHILDREN: Literal[2]
ACTION_INSERT_AFTER: Literal[3]
ACTION_INSERT_BEFORE: Literal[4]
def __init__(self) -> None: ...
def setFeature(self, name: str, state: int) -> None: ...
def supportsFeature(self, name: str) -> bool: ...
def canSetFeature(self, name: str, state: int) -> bool: ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/xml/sax/handler.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class ErrorHandler:
def warning(self, exception: BaseException) -> None: ...

class ContentHandler:
def __init__(self) -> None: ...
def setDocumentLocator(self, locator): ...
def startDocument(self): ...
def endDocument(self): ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/xml/sax/xmlreader.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from collections.abc import Mapping

class XMLReader:
def __init__(self) -> None: ...
def parse(self, source): ...
def getContentHandler(self): ...
def setContentHandler(self, handler): ...
Expand Down
1 change: 0 additions & 1 deletion stdlib/xmlrpc/server.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ class XMLRPCDocGenerator: # undocumented
server_name: str
server_documentation: str
server_title: str
def __init__(self) -> None: ...
def set_server_title(self, server_title: str) -> None: ...
def set_server_name(self, server_name: str) -> None: ...
def set_server_documentation(self, server_documentation: str) -> None: ...
Expand Down