Remove empty __init__ methods (#8816)

This commit is contained in:
Nikita Sobolev
2022-09-30 15:08:41 +03:00
committed by GitHub
parent deff426b6f
commit 380022c650
33 changed files with 1 additions and 44 deletions

View File

@@ -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
@@ -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
@@ -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: ...

View File

@@ -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(

View File

@@ -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

View File

@@ -10,7 +10,6 @@ LINELEN: Literal[64]
RUNCHAR: Literal[b"\x90"]
class FInfo:
def __init__(self) -> None: ...
Type: str
Creator: str
Flags: int

View File

@@ -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: ...

View File

@@ -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: ...
@@ -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): ...

View File

@@ -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: ...

View File

@@ -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]: ...
@@ -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: ...

View File

@@ -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: ...

View File

@@ -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: ...

View File

@@ -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: ...

View File

@@ -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: ...

View File

@@ -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:

View File

@@ -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: ...

View File

@@ -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: ...

View File

@@ -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]: ...

View File

@@ -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: ...

View File

@@ -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

View File

@@ -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: ...

View File

@@ -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: ...
@@ -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: ...

View File

@@ -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: ...

View File

@@ -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: ...

View File

@@ -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: ...

View File

@@ -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: ...

View File

@@ -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
@@ -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
@@ -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: ...

View File

@@ -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: ...

View File

@@ -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]: ...

View File

@@ -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

View File

@@ -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: ...

View File

@@ -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: ...

View File

@@ -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): ...

View File

@@ -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): ...

View File

@@ -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: ...