mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Upgrade black version (#7089)
This commit is contained in:
@@ -50,6 +50,7 @@ if sys.platform != "win32":
|
||||
RequestHandlerClass: Callable[..., BaseRequestHandler],
|
||||
bind_and_activate: bool = ...,
|
||||
) -> None: ...
|
||||
|
||||
class UnixDatagramServer(BaseServer):
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
@@ -113,6 +113,7 @@ if sys.platform != "win32":
|
||||
def write(self, data: bytes, flags: int = ...) -> int: ...
|
||||
def close(self) -> None: ...
|
||||
def fileno(self) -> int: ...
|
||||
|
||||
class file_dispatcher(dispatcher):
|
||||
def __init__(self, fd: FileDescriptorLike, map: _maptype | None = ...) -> None: ...
|
||||
def set_file(self, fd: int) -> None: ...
|
||||
|
||||
@@ -2,6 +2,7 @@ import sys
|
||||
|
||||
if sys.platform == "win32":
|
||||
from distutils.cmd import Command
|
||||
|
||||
class bdist_msi(Command):
|
||||
def initialize_options(self) -> None: ...
|
||||
def finalize_options(self) -> None: ...
|
||||
|
||||
@@ -30,6 +30,7 @@ class mmap(Sequence[bytes]):
|
||||
def __init__(
|
||||
self, fileno: int, length: int, flags: int = ..., prot: int = ..., access: int = ..., offset: int = ...
|
||||
) -> None: ...
|
||||
|
||||
def close(self) -> None: ...
|
||||
def flush(self, offset: int = ..., size: int = ...) -> int: ...
|
||||
def move(self, dest: int, src: int, count: int) -> None: ...
|
||||
|
||||
@@ -21,6 +21,7 @@ if sys.platform == "win32":
|
||||
type_nullable: Literal[0x1000]
|
||||
type_key: Literal[0x2000]
|
||||
knownbits: Literal[0x3FFF]
|
||||
|
||||
class Table:
|
||||
|
||||
name: str
|
||||
@@ -29,7 +30,9 @@ if sys.platform == "win32":
|
||||
def add_field(self, index: int, name: str, type: int) -> None: ...
|
||||
def sql(self) -> str: ...
|
||||
def create(self, db: _Database) -> None: ...
|
||||
|
||||
class _Unspecified: ...
|
||||
|
||||
def change_sequence(
|
||||
seq: Sequence[tuple[str, str | None, int]],
|
||||
action: str,
|
||||
@@ -44,6 +47,7 @@ if sys.platform == "win32":
|
||||
def add_tables(db: _Database, module: ModuleType) -> None: ...
|
||||
def make_id(str: str) -> str: ...
|
||||
def gen_uuid() -> str: ...
|
||||
|
||||
class CAB:
|
||||
|
||||
name: str
|
||||
@@ -55,6 +59,7 @@ if sys.platform == "win32":
|
||||
def append(self, full: str, file: str, logical: str) -> tuple[int, str]: ...
|
||||
def commit(self, db: _Database) -> None: ...
|
||||
_directories: set[str]
|
||||
|
||||
class Directory:
|
||||
|
||||
db: _Database
|
||||
@@ -90,10 +95,12 @@ if sys.platform == "win32":
|
||||
def add_file(self, file: str, src: str | None = ..., version: str | None = ..., language: str | None = ...) -> str: ...
|
||||
def glob(self, pattern: str, exclude: Container[str] | None = ...) -> list[str]: ...
|
||||
def remove_pyc(self) -> None: ...
|
||||
|
||||
class Binary:
|
||||
|
||||
name: str
|
||||
def __init__(self, fname: str) -> None: ...
|
||||
|
||||
class Feature:
|
||||
|
||||
id: str
|
||||
@@ -110,6 +117,7 @@ if sys.platform == "win32":
|
||||
attributes: int = ...,
|
||||
) -> None: ...
|
||||
def set_current(self) -> None: ...
|
||||
|
||||
class Control:
|
||||
|
||||
dlg: Dialog
|
||||
@@ -118,12 +126,14 @@ if sys.platform == "win32":
|
||||
def event(self, event: str, argument: str, condition: str = ..., ordering: int | None = ...) -> None: ...
|
||||
def mapping(self, event: str, attribute: str) -> None: ...
|
||||
def condition(self, action: str, condition: str) -> None: ...
|
||||
|
||||
class RadioButtonGroup(Control):
|
||||
|
||||
property: str
|
||||
index: int
|
||||
def __init__(self, dlg: Dialog, name: str, property: str) -> None: ...
|
||||
def add(self, name: str, x: int, y: int, w: int, h: int, text: str, value: str | None = ...) -> None: ...
|
||||
|
||||
class Dialog:
|
||||
|
||||
db: _Database
|
||||
|
||||
@@ -5,4 +5,5 @@ if sys.platform != "win32":
|
||||
def get_default_domain() -> str: ...
|
||||
def maps(domain: str = ...) -> list[str]: ...
|
||||
def match(key: str, map: str, domain: str = ...) -> str: ...
|
||||
|
||||
class error(Exception): ...
|
||||
|
||||
@@ -235,6 +235,7 @@ if sys.platform != "win32":
|
||||
def fchown(fd: int, uid: int, gid: int) -> None: ...
|
||||
if sys.platform != "darwin":
|
||||
def fdatasync(fd: FileDescriptorLike) -> None: ... # Unix only, not Mac
|
||||
|
||||
def fpathconf(fd: int, name: str | int) -> int: ...
|
||||
def fstatvfs(fd: int) -> _StatVFS: ...
|
||||
def ftruncate(fd: int, length: int) -> None: ...
|
||||
|
||||
@@ -18,6 +18,7 @@ if sys.platform != "win32":
|
||||
RLIMIT_MEMLOCK: int
|
||||
RLIMIT_VMEM: int
|
||||
RLIMIT_AS: int
|
||||
|
||||
class _RUsage(NamedTuple):
|
||||
ru_utime: float
|
||||
ru_stime: float
|
||||
|
||||
@@ -404,6 +404,7 @@ class socket:
|
||||
def gettimeout(self) -> float | None: ...
|
||||
if sys.platform == "win32":
|
||||
def ioctl(self, control: int, option: int | tuple[int, int, int]) -> None: ...
|
||||
|
||||
def listen(self, __backlog: int) -> None: ...
|
||||
# Note that the makefile's documented windows-specific behavior is not represented
|
||||
def makefile(self, mode: unicode = ..., buffering: int = ...) -> BinaryIO: ...
|
||||
@@ -422,6 +423,7 @@ class socket:
|
||||
def setsockopt(self, level: int, optname: int, value: int | bytes) -> None: ...
|
||||
if sys.platform == "win32":
|
||||
def share(self, process_id: int) -> bytes: ...
|
||||
|
||||
def shutdown(self, how: int) -> None: ...
|
||||
|
||||
# ----- Functions -----
|
||||
|
||||
@@ -243,4 +243,5 @@ if sys.platform != "win32":
|
||||
def tcdrain(__fd: FileDescriptorLike) -> None: ...
|
||||
def tcflush(__fd: FileDescriptorLike, __queue: int) -> None: ...
|
||||
def tcflow(__fd: FileDescriptorLike, __action: int) -> None: ...
|
||||
|
||||
class error(Exception): ...
|
||||
|
||||
@@ -91,6 +91,7 @@ if sys.platform == "darwin":
|
||||
name: str
|
||||
def __init__(self, name: Text) -> None: ...
|
||||
def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ...
|
||||
|
||||
class MacOSXOSAScript(BaseBrowser):
|
||||
def __init__(self, name: Text) -> None: ...
|
||||
def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ...
|
||||
|
||||
@@ -25,8 +25,10 @@ class mod(AST): ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
class type_ignore(AST): ...
|
||||
|
||||
class TypeIgnore(type_ignore):
|
||||
tag: str
|
||||
|
||||
class FunctionType(mod):
|
||||
argtypes: list[expr]
|
||||
returns: expr
|
||||
@@ -228,12 +230,16 @@ class JoinedStr(expr):
|
||||
if sys.version_info < (3, 8):
|
||||
class Num(expr): # Deprecated in 3.8; use Constant
|
||||
n: complex
|
||||
|
||||
class Str(expr): # Deprecated in 3.8; use Constant
|
||||
s: str
|
||||
|
||||
class Bytes(expr): # Deprecated in 3.8; use Constant
|
||||
s: bytes
|
||||
|
||||
class NameConstant(expr): # Deprecated in 3.8; use Constant
|
||||
value: Any
|
||||
|
||||
class Ellipsis(expr): ... # Deprecated in 3.8; use Constant
|
||||
|
||||
class Constant(expr):
|
||||
@@ -267,6 +273,7 @@ class Slice(_SliceT):
|
||||
if sys.version_info < (3, 9):
|
||||
class ExtSlice(slice):
|
||||
dims: list[slice]
|
||||
|
||||
class Index(slice):
|
||||
value: expr
|
||||
|
||||
@@ -297,6 +304,7 @@ if sys.version_info < (3, 9):
|
||||
class AugLoad(expr_context): ...
|
||||
class AugStore(expr_context): ...
|
||||
class Param(expr_context): ...
|
||||
|
||||
class Suite(mod):
|
||||
body: list[stmt]
|
||||
|
||||
@@ -380,32 +388,42 @@ if sys.version_info >= (3, 10):
|
||||
class Match(stmt):
|
||||
subject: expr
|
||||
cases: list[match_case]
|
||||
|
||||
class pattern(AST): ...
|
||||
# Without the alias, Pyright complains variables named pattern are recursively defined
|
||||
_pattern = pattern
|
||||
|
||||
class match_case(AST):
|
||||
pattern: _pattern
|
||||
guard: expr | None
|
||||
body: list[stmt]
|
||||
|
||||
class MatchValue(pattern):
|
||||
value: expr
|
||||
|
||||
class MatchSingleton(pattern):
|
||||
value: Literal[True, False, None]
|
||||
|
||||
class MatchSequence(pattern):
|
||||
patterns: list[pattern]
|
||||
|
||||
class MatchStar(pattern):
|
||||
name: _identifier | None
|
||||
|
||||
class MatchMapping(pattern):
|
||||
keys: list[expr]
|
||||
patterns: list[pattern]
|
||||
rest: _identifier | None
|
||||
|
||||
class MatchClass(pattern):
|
||||
cls: expr
|
||||
patterns: list[pattern]
|
||||
kwd_attrs: list[_identifier]
|
||||
kwd_patterns: list[pattern]
|
||||
|
||||
class MatchAs(pattern):
|
||||
pattern: _pattern | None
|
||||
name: _identifier | None
|
||||
|
||||
class MatchOr(pattern):
|
||||
patterns: list[pattern]
|
||||
|
||||
@@ -280,6 +280,7 @@ if sys.platform != "win32":
|
||||
def color_pair(pair_number: int) -> int: ...
|
||||
else:
|
||||
def color_pair(__color_number: int) -> int: ...
|
||||
|
||||
def curs_set(__visibility: int) -> int: ...
|
||||
def def_prog_mode() -> None: ...
|
||||
def def_shell_mode() -> None: ...
|
||||
@@ -294,6 +295,7 @@ if sys.platform != "win32":
|
||||
if sys.version_info >= (3, 9):
|
||||
def get_escdelay() -> int: ...
|
||||
def get_tabsize() -> int: ...
|
||||
|
||||
def getmouse() -> tuple[int, int, int, int, int]: ...
|
||||
def getsyx() -> tuple[int, int]: ...
|
||||
def getwin(__file: SupportsRead[bytes]) -> _CursesWindow: ...
|
||||
@@ -301,6 +303,7 @@ if sys.platform != "win32":
|
||||
def has_colors() -> bool: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
def has_extended_color_support() -> bool: ...
|
||||
|
||||
def has_ic() -> bool: ...
|
||||
def has_il() -> bool: ...
|
||||
def has_key(__key: int) -> bool: ...
|
||||
@@ -339,6 +342,7 @@ if sys.platform != "win32":
|
||||
if sys.version_info >= (3, 9):
|
||||
def set_escdelay(__ms: int) -> None: ...
|
||||
def set_tabsize(__size: int) -> None: ...
|
||||
|
||||
def setsyx(__y: int, __x: int) -> None: ...
|
||||
def setupterm(term: str | None = ..., fd: int = ...) -> None: ...
|
||||
def start_color() -> None: ...
|
||||
@@ -367,7 +371,9 @@ if sys.platform != "win32":
|
||||
def update_lines_cols() -> None: ...
|
||||
def use_default_colors() -> None: ...
|
||||
def use_env(__flag: bool) -> None: ...
|
||||
|
||||
class error(Exception): ...
|
||||
|
||||
class _CursesWindow:
|
||||
encoding: str
|
||||
@overload
|
||||
|
||||
@@ -55,9 +55,11 @@ class Thread:
|
||||
if sys.version_info >= (3, 8):
|
||||
@property
|
||||
def native_id(self) -> int | None: ... # only available on some platforms
|
||||
|
||||
def is_alive(self) -> bool: ...
|
||||
if sys.version_info < (3, 9):
|
||||
def isAlive(self) -> bool: ...
|
||||
|
||||
def isDaemon(self) -> bool: ...
|
||||
def setDaemon(self, daemonic: bool) -> None: ...
|
||||
|
||||
|
||||
@@ -547,9 +547,11 @@ class socket:
|
||||
def getsockopt(self, __level: int, __optname: int, __buflen: int) -> bytes: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def getblocking(self) -> bool: ...
|
||||
|
||||
def gettimeout(self) -> float | None: ...
|
||||
if sys.platform == "win32":
|
||||
def ioctl(self, __control: int, __option: int | tuple[int, int, int] | bool) -> None: ...
|
||||
|
||||
def listen(self, __backlog: int = ...) -> None: ...
|
||||
def recv(self, __bufsize: int, __flags: int = ...) -> bytes: ...
|
||||
def recvfrom(self, __bufsize: int, __flags: int = ...) -> tuple[bytes, _RetAddress]: ...
|
||||
@@ -558,6 +560,7 @@ class socket:
|
||||
def recvmsg_into(
|
||||
self, __buffers: Iterable[WriteableBuffer], __ancbufsize: int = ..., __flags: int = ...
|
||||
) -> tuple[int, list[_CMSG], int, Any]: ...
|
||||
|
||||
def recvfrom_into(self, buffer: WriteableBuffer, nbytes: int = ..., flags: int = ...) -> tuple[int, _RetAddress]: ...
|
||||
def recv_into(self, buffer: WriteableBuffer, nbytes: int = ..., flags: int = ...) -> int: ...
|
||||
def send(self, __data: ReadableBuffer, __flags: int = ...) -> int: ...
|
||||
@@ -578,6 +581,7 @@ class socket:
|
||||
def sendmsg_afalg(
|
||||
self, msg: Iterable[ReadableBuffer] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ...
|
||||
) -> int: ...
|
||||
|
||||
def setblocking(self, __flag: bool) -> None: ...
|
||||
def settimeout(self, __value: float | None) -> None: ...
|
||||
@overload
|
||||
@@ -586,6 +590,7 @@ class socket:
|
||||
def setsockopt(self, __level: int, __optname: int, __value: None, __optlen: int) -> None: ...
|
||||
if sys.platform == "win32":
|
||||
def share(self, __process_id: int) -> bytes: ...
|
||||
|
||||
def shutdown(self, __how: int) -> None: ...
|
||||
|
||||
SocketType = socket
|
||||
|
||||
@@ -55,6 +55,7 @@ class TkappType:
|
||||
if sys.platform != "win32":
|
||||
def createfilehandler(self, __file, __mask, __func): ...
|
||||
def deletefilehandler(self, __file): ...
|
||||
|
||||
def createtimerhandler(self, __milliseconds, __func): ...
|
||||
def deletecommand(self, __name): ...
|
||||
def dooneevent(self, __flags: int = ...): ...
|
||||
@@ -79,6 +80,7 @@ class TkappType:
|
||||
def setvar(self, *ags, **kwargs): ...
|
||||
if sys.version_info < (3, 11):
|
||||
def split(self, __arg): ...
|
||||
|
||||
def splitlist(self, __arg): ...
|
||||
def unsetvar(self, *args, **kwargs): ...
|
||||
def wantobjects(self, *args, **kwargs): ...
|
||||
|
||||
@@ -160,6 +160,7 @@ if sys.platform == "win32":
|
||||
if sys.version_info >= (3, 7):
|
||||
def GetACP() -> int: ...
|
||||
def GetFileType(handle: int) -> int: ...
|
||||
|
||||
def GetCurrentProcess() -> int: ...
|
||||
def GetExitCodeProcess(__process: int) -> int: ...
|
||||
def GetLastError() -> int: ...
|
||||
|
||||
@@ -193,6 +193,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
||||
help: str | None = ...,
|
||||
metavar: str | None = ...,
|
||||
) -> _SubParsersAction[_ArgumentParserT]: ...
|
||||
|
||||
def print_usage(self, file: IO[str] | None = ...) -> None: ...
|
||||
def print_help(self, file: IO[str] | None = ...) -> None: ...
|
||||
def format_usage(self) -> str: ...
|
||||
|
||||
@@ -35,6 +35,7 @@ class array(MutableSequence[_T], Generic[_T]):
|
||||
def index(self, __v: _T, __start: int = ..., __stop: int = ...) -> int: ...
|
||||
else:
|
||||
def index(self, __v: _T) -> int: ... # type: ignore # Overrides Sequence
|
||||
|
||||
def insert(self, __i: int, __v: _T) -> None: ...
|
||||
def pop(self, __i: int = ...) -> _T: ...
|
||||
def remove(self, __v: _T) -> None: ...
|
||||
@@ -46,6 +47,7 @@ class array(MutableSequence[_T], Generic[_T]):
|
||||
if sys.version_info < (3, 9):
|
||||
def fromstring(self, __buffer: bytes) -> None: ...
|
||||
def tostring(self) -> bytes: ...
|
||||
|
||||
def __len__(self) -> int: ...
|
||||
@overload
|
||||
def __getitem__(self, __i: SupportsIndex) -> _T: ...
|
||||
|
||||
@@ -15,14 +15,17 @@ from typing_extensions import Literal
|
||||
if sys.version_info >= (3, 8):
|
||||
class Num(Constant):
|
||||
value: complex
|
||||
|
||||
class Str(Constant):
|
||||
value: str
|
||||
# Aliases for value, for backwards compatibility
|
||||
s: str
|
||||
|
||||
class Bytes(Constant):
|
||||
value: bytes
|
||||
# Aliases for value, for backwards compatibility
|
||||
s: bytes
|
||||
|
||||
class NameConstant(Constant): ...
|
||||
class Ellipsis(Constant): ...
|
||||
|
||||
@@ -88,6 +91,7 @@ class NodeVisitor:
|
||||
def visit_Constant(self, node: Constant) -> Any: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def visit_NamedExpr(self, node: NamedExpr) -> Any: ...
|
||||
|
||||
def visit_Attribute(self, node: Attribute) -> Any: ...
|
||||
def visit_Subscript(self, node: Subscript) -> Any: ...
|
||||
def visit_Starred(self, node: Starred) -> Any: ...
|
||||
|
||||
@@ -69,6 +69,7 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta):
|
||||
def call_soon(self, callback: Callable[..., Any], *args: Any) -> Handle: ...
|
||||
def call_later(self, delay: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ...
|
||||
def call_at(self, when: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ...
|
||||
|
||||
def time(self) -> float: ...
|
||||
# Future methods
|
||||
def create_future(self) -> Future[Any]: ...
|
||||
@@ -77,6 +78,7 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta):
|
||||
def create_task(self, coro: Awaitable[_T] | Generator[Any, None, _T], *, name: object = ...) -> Task[_T]: ...
|
||||
else:
|
||||
def create_task(self, coro: Awaitable[_T] | Generator[Any, None, _T]) -> Task[_T]: ...
|
||||
|
||||
def set_task_factory(self, factory: Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]] | None) -> None: ...
|
||||
def get_task_factory(self) -> Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]] | None: ...
|
||||
# Methods for interacting with threads
|
||||
@@ -84,6 +86,7 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta):
|
||||
def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any, context: Context | None = ...) -> Handle: ...
|
||||
else:
|
||||
def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any) -> Handle: ...
|
||||
|
||||
def run_in_executor(self, executor: Any, func: Callable[..., _T], *args: Any) -> Future[_T]: ...
|
||||
def set_default_executor(self, executor: Any) -> None: ...
|
||||
# Network I/O methods returning Futures.
|
||||
|
||||
@@ -32,6 +32,7 @@ class Handle:
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, callback: Callable[..., Any], args: Sequence[Any], loop: AbstractEventLoop) -> None: ...
|
||||
|
||||
def cancel(self) -> None: ...
|
||||
def _run(self) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
@@ -49,6 +50,7 @@ class TimerHandle(Handle):
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, when: float, callback: Callable[..., Any], args: Sequence[Any], loop: AbstractEventLoop) -> None: ...
|
||||
|
||||
def __hash__(self) -> int: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def when(self) -> float: ...
|
||||
@@ -62,6 +64,7 @@ class AbstractServer:
|
||||
def is_serving(self) -> bool: ...
|
||||
async def start_serving(self) -> None: ...
|
||||
async def serve_forever(self) -> None: ...
|
||||
|
||||
async def wait_closed(self) -> None: ...
|
||||
|
||||
class AbstractEventLoop(metaclass=ABCMeta):
|
||||
@@ -104,6 +107,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
else:
|
||||
@abstractmethod
|
||||
def create_task(self, coro: Awaitable[_T] | Generator[Any, None, _T]) -> Task[_T]: ...
|
||||
|
||||
@abstractmethod
|
||||
def set_task_factory(self, factory: Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]] | None) -> None: ...
|
||||
@abstractmethod
|
||||
@@ -357,6 +361,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
backlog: int = ...,
|
||||
ssl: _SSLContext = ...,
|
||||
) -> Server: ...
|
||||
|
||||
@abstractmethod
|
||||
async def create_datagram_endpoint(
|
||||
self,
|
||||
|
||||
@@ -6,6 +6,7 @@ from .events import AbstractEventLoop
|
||||
|
||||
if sys.version_info < (3, 8):
|
||||
from concurrent.futures import CancelledError as CancelledError, TimeoutError as TimeoutError
|
||||
|
||||
class InvalidStateError(Error): ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
@@ -48,6 +49,7 @@ class Future(Awaitable[_T], Iterable[_T]):
|
||||
def cancel(self, msg: Any | None = ...) -> bool: ...
|
||||
else:
|
||||
def cancel(self) -> bool: ...
|
||||
|
||||
def cancelled(self) -> bool: ...
|
||||
def done(self) -> bool: ...
|
||||
def result(self) -> _T: ...
|
||||
|
||||
@@ -21,6 +21,7 @@ else:
|
||||
def __init__(self, lock: Lock | Semaphore) -> None: ...
|
||||
def __enter__(self) -> object: ...
|
||||
def __exit__(self, *args: Any) -> None: ...
|
||||
|
||||
class _ContextManagerMixin:
|
||||
def __init__(self, lock: Lock | Semaphore) -> None: ...
|
||||
# Apparently this exists to *prohibit* use as a context manager.
|
||||
|
||||
@@ -25,6 +25,7 @@ class _ProactorBasePipeTransport(transports._FlowControlMixin, transports.BaseTr
|
||||
def __del__(self, _warn: _WarnCallbackProtocol = ...) -> None: ...
|
||||
else:
|
||||
def __del__(self) -> None: ...
|
||||
|
||||
def get_write_buffer_size(self) -> int: ...
|
||||
|
||||
class _ProactorReadPipeTransport(_ProactorBasePipeTransport, transports.ReadTransport):
|
||||
|
||||
@@ -57,6 +57,7 @@ class _SSLProtocolTransport(transports._FlowControlMixin, transports.Transport):
|
||||
def close(self) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def is_reading(self) -> bool: ...
|
||||
|
||||
def pause_reading(self) -> None: ...
|
||||
def resume_reading(self) -> None: ...
|
||||
def set_write_buffer_limits(self, high: int | None = ..., low: int | None = ...) -> None: ...
|
||||
@@ -64,6 +65,7 @@ class _SSLProtocolTransport(transports._FlowControlMixin, transports.Transport):
|
||||
if sys.version_info >= (3, 7):
|
||||
@property
|
||||
def _protocol_paused(self) -> bool: ...
|
||||
|
||||
def write(self, data: bytes) -> None: ...
|
||||
def can_write_eof(self) -> Literal[False]: ...
|
||||
def abort(self) -> None: ...
|
||||
@@ -114,6 +116,7 @@ class SSLProtocol(protocols.Protocol):
|
||||
) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def _set_app_protocol(self, app_protocol: protocols.BaseProtocol) -> None: ...
|
||||
|
||||
def _wakeup_waiter(self, exc: BaseException | None = ...) -> None: ...
|
||||
def connection_made(self, transport: transports.BaseTransport) -> None: ...
|
||||
def connection_lost(self, exc: BaseException | None) -> None: ...
|
||||
@@ -127,6 +130,7 @@ class SSLProtocol(protocols.Protocol):
|
||||
def _start_handshake(self) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def _check_handshake_timeout(self) -> None: ...
|
||||
|
||||
def _on_handshake_complete(self, handshake_exc: BaseException | None) -> None: ...
|
||||
def _process_write_backlog(self) -> None: ...
|
||||
def _fatal_error(self, exc: BaseException, message: str = ...) -> None: ...
|
||||
|
||||
@@ -12,6 +12,7 @@ if sys.version_info < (3, 8):
|
||||
expected: int | None
|
||||
partial: bytes
|
||||
def __init__(self, partial: bytes, expected: int | None) -> None: ...
|
||||
|
||||
class LimitOverrunError(Exception):
|
||||
consumed: int
|
||||
def __init__(self, message: str, consumed: int) -> None: ...
|
||||
@@ -114,6 +115,7 @@ class StreamWriter:
|
||||
if sys.version_info >= (3, 7):
|
||||
def is_closing(self) -> bool: ...
|
||||
async def wait_closed(self) -> None: ...
|
||||
|
||||
def get_extra_info(self, name: str, default: Any = ...) -> Any: ...
|
||||
async def drain(self) -> None: ...
|
||||
|
||||
|
||||
@@ -269,6 +269,7 @@ class Task(Future[_T], Generic[_T]):
|
||||
def get_coro(self) -> Generator[_TaskYieldType, None, _T] | Awaitable[_T]: ...
|
||||
def get_name(self) -> str: ...
|
||||
def set_name(self, __value: object) -> None: ...
|
||||
|
||||
def get_stack(self, *, limit: int | None = ...) -> list[FrameType]: ...
|
||||
def print_stack(self, *, limit: int | None = ..., file: TextIO | None = ...) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
@@ -291,6 +292,7 @@ if sys.version_info >= (3, 7):
|
||||
def create_task(coro: Generator[_TaskYieldType, None, _T] | Awaitable[_T], *, name: str | None = ...) -> Task[_T]: ...
|
||||
else:
|
||||
def create_task(coro: Generator[_TaskYieldType, None, _T] | Awaitable[_T]) -> Task[_T]: ...
|
||||
|
||||
def current_task(loop: AbstractEventLoop | None = ...) -> Task[Any] | None: ...
|
||||
def _enter_task(loop: AbstractEventLoop, task: Task[Any]) -> None: ...
|
||||
def _leave_task(loop: AbstractEventLoop, task: Task[Any]) -> None: ...
|
||||
|
||||
@@ -15,6 +15,7 @@ class BaseTransport:
|
||||
class ReadTransport(BaseTransport):
|
||||
if sys.version_info >= (3, 7):
|
||||
def is_reading(self) -> bool: ...
|
||||
|
||||
def pause_reading(self) -> None: ...
|
||||
def resume_reading(self) -> None: ...
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ class TransportSocket:
|
||||
def ioctl(self, control: int, option: int | tuple[int, int, int] | bool) -> None: ...
|
||||
else:
|
||||
def ioctl(self, control: int, option: int | tuple[int, int, int] | bool) -> NoReturn: ...
|
||||
|
||||
def listen(self, __backlog: int = ...) -> None: ...
|
||||
def makefile(self) -> BinaryIO: ...
|
||||
def sendfile(self, file: BinaryIO, offset: int = ..., count: int | None = ...) -> int: ...
|
||||
@@ -56,6 +57,7 @@ class TransportSocket:
|
||||
def sendmsg_afalg(
|
||||
self, msg: Iterable[bytes] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ...
|
||||
) -> NoReturn: ...
|
||||
|
||||
def sendmsg(
|
||||
self, __buffers: Iterable[bytes], __ancdata: Iterable[_CMSG] = ..., __flags: int = ..., __address: _Address = ...
|
||||
) -> int: ...
|
||||
@@ -70,6 +72,7 @@ class TransportSocket:
|
||||
def share(self, process_id: int) -> bytes: ...
|
||||
else:
|
||||
def share(self, process_id: int) -> NoReturn: ...
|
||||
|
||||
def recv_into(self, buffer: _WriteBuffer, nbytes: int = ..., flags: int = ...) -> int: ...
|
||||
def recvfrom_into(self, buffer: _WriteBuffer, nbytes: int = ..., flags: int = ...) -> tuple[int, _RetAddress]: ...
|
||||
def recvmsg_into(
|
||||
|
||||
@@ -24,10 +24,13 @@ class AbstractChildWatcher:
|
||||
if sys.platform != "win32":
|
||||
class BaseChildWatcher(AbstractChildWatcher):
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
class SafeChildWatcher(BaseChildWatcher):
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
|
||||
class FastChildWatcher(BaseChildWatcher):
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
|
||||
class _UnixSelectorEventLoop(BaseSelectorEventLoop):
|
||||
if sys.version_info < (3, 7):
|
||||
async def create_unix_server(
|
||||
@@ -39,6 +42,7 @@ if sys.platform != "win32":
|
||||
backlog: int = ...,
|
||||
ssl: _SSLContext = ...,
|
||||
) -> Server: ...
|
||||
|
||||
class _UnixDefaultEventLoopPolicy(BaseDefaultEventLoopPolicy):
|
||||
def get_child_watcher(self) -> AbstractChildWatcher: ...
|
||||
def set_child_watcher(self, watcher: AbstractChildWatcher | None) -> None: ...
|
||||
@@ -49,12 +53,15 @@ if sys.platform != "win32":
|
||||
if sys.version_info >= (3, 8):
|
||||
|
||||
from typing import Protocol
|
||||
|
||||
class _Warn(Protocol):
|
||||
def __call__(
|
||||
self, message: str, category: type[Warning] | None = ..., stacklevel: int = ..., source: Any | None = ...
|
||||
) -> None: ...
|
||||
|
||||
class MultiLoopChildWatcher(AbstractChildWatcher):
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
|
||||
class ThreadedChildWatcher(AbstractChildWatcher):
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __del__(self, _warn: _Warn = ...) -> None: ...
|
||||
|
||||
@@ -25,12 +25,15 @@ if sys.platform == "win32":
|
||||
ERROR_CONNECTION_ABORTED: Literal[1236]
|
||||
CONNECT_PIPE_INIT_DELAY: float
|
||||
CONNECT_PIPE_MAX_DELAY: float
|
||||
|
||||
class PipeServer:
|
||||
def __init__(self, address: str) -> None: ...
|
||||
def __del__(self) -> None: ...
|
||||
def closed(self) -> bool: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
class _WindowsSelectorEventLoop(selector_events.BaseSelectorEventLoop): ...
|
||||
|
||||
class ProactorEventLoop(proactor_events.BaseProactorEventLoop):
|
||||
def __init__(self, proactor: IocpProactor | None = ...) -> None: ...
|
||||
async def create_pipe_connection(
|
||||
@@ -39,6 +42,7 @@ if sys.platform == "win32":
|
||||
async def start_serving_pipe(
|
||||
self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str
|
||||
) -> list[PipeServer]: ...
|
||||
|
||||
class IocpProactor:
|
||||
def __init__(self, concurrency: int = ...) -> None: ...
|
||||
def __del__(self) -> None: ...
|
||||
@@ -47,11 +51,13 @@ if sys.platform == "win32":
|
||||
def recv(self, conn: socket.socket, nbytes: int, flags: int = ...) -> futures.Future[bytes]: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def recv_into(self, conn: socket.socket, buf: WriteableBuffer, flags: int = ...) -> futures.Future[Any]: ...
|
||||
|
||||
def send(self, conn: socket.socket, buf: WriteableBuffer, flags: int = ...) -> futures.Future[Any]: ...
|
||||
def accept(self, listener: socket.socket) -> futures.Future[Any]: ...
|
||||
def connect(self, conn: socket.socket, address: bytes) -> futures.Future[Any]: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def sendfile(self, sock: socket.socket, file: IO[bytes], offset: int, count: int) -> futures.Future[Any]: ...
|
||||
|
||||
def accept_pipe(self, pipe: socket.socket) -> futures.Future[Any]: ...
|
||||
async def connect_pipe(self, address: bytes) -> windows_utils.PipeHandle: ...
|
||||
def wait_for_handle(self, handle: windows_utils.PipeHandle, timeout: int | None = ...) -> bool: ...
|
||||
@@ -63,6 +69,7 @@ if sys.platform == "win32":
|
||||
_loop_factory: ClassVar[type[SelectorEventLoop]]
|
||||
def get_child_watcher(self) -> NoReturn: ...
|
||||
def set_child_watcher(self, watcher: Any) -> NoReturn: ...
|
||||
|
||||
class WindowsProactorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
|
||||
_loop_factory: ClassVar[type[ProactorEventLoop]]
|
||||
def get_child_watcher(self) -> NoReturn: ...
|
||||
|
||||
@@ -14,12 +14,14 @@ if sys.platform == "win32":
|
||||
PIPE = subprocess.PIPE
|
||||
STDOUT = subprocess.STDOUT
|
||||
def pipe(*, duplex: bool = ..., overlapped: tuple[bool, bool] = ..., bufsize: int = ...) -> tuple[int, int]: ...
|
||||
|
||||
class PipeHandle:
|
||||
def __init__(self, handle: int) -> None: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def __del__(self, _warn: _WarnFunction = ...) -> None: ...
|
||||
else:
|
||||
def __del__(self) -> None: ...
|
||||
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(self, t: type | None, v: BaseException | None, tb: TracebackType | None) -> None: ...
|
||||
@property
|
||||
|
||||
@@ -85,6 +85,7 @@ if sys.platform != "win32":
|
||||
def write(self, data: bytes, flags: int = ...) -> int: ...
|
||||
def close(self) -> None: ...
|
||||
def fileno(self) -> int: ...
|
||||
|
||||
class file_dispatcher(dispatcher):
|
||||
def __init__(self, fd: FileDescriptorLike, map: _maptype | None = ...) -> None: ...
|
||||
def set_file(self, fd: int) -> None: ...
|
||||
|
||||
@@ -108,6 +108,7 @@ class object:
|
||||
def __reduce_ex__(self, __protocol: SupportsIndex) -> str | tuple[Any, ...]: ...
|
||||
else:
|
||||
def __reduce_ex__(self, __protocol: int) -> str | tuple[Any, ...]: ...
|
||||
|
||||
def __dir__(self) -> Iterable[str]: ...
|
||||
def __init_subclass__(cls) -> None: ...
|
||||
|
||||
@@ -185,6 +186,7 @@ class int:
|
||||
def __new__(cls: type[Self], __x: str | bytes | bytearray, base: SupportsIndex) -> Self: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def as_integer_ratio(self) -> tuple[int, Literal[1]]: ...
|
||||
|
||||
@property
|
||||
def real(self) -> int: ...
|
||||
@property
|
||||
@@ -197,6 +199,7 @@ class int:
|
||||
def bit_length(self) -> int: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
def bit_count(self) -> int: ...
|
||||
|
||||
def to_bytes(self, length: SupportsIndex, byteorder: Literal["little", "big"], *, signed: bool = ...) -> bytes: ...
|
||||
@classmethod
|
||||
def from_bytes(
|
||||
@@ -303,6 +306,7 @@ class float:
|
||||
if sys.version_info >= (3, 9):
|
||||
def __ceil__(self) -> int: ...
|
||||
def __floor__(self) -> int: ...
|
||||
|
||||
@overload
|
||||
def __round__(self, __ndigits: None = ...) -> int: ...
|
||||
@overload
|
||||
@@ -371,6 +375,7 @@ class str(Sequence[str]):
|
||||
def expandtabs(self, tabsize: SupportsIndex = ...) -> str: ...
|
||||
else:
|
||||
def expandtabs(self, tabsize: int = ...) -> str: ...
|
||||
|
||||
def find(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
|
||||
def format(self, *args: object, **kwargs: object) -> str: ...
|
||||
def format_map(self, map: _FormatMapMapping) -> str: ...
|
||||
@@ -379,6 +384,7 @@ class str(Sequence[str]):
|
||||
def isalpha(self) -> bool: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def isascii(self) -> bool: ...
|
||||
|
||||
def isdecimal(self) -> bool: ...
|
||||
def isdigit(self) -> bool: ...
|
||||
def isidentifier(self) -> bool: ...
|
||||
@@ -397,6 +403,7 @@ class str(Sequence[str]):
|
||||
if sys.version_info >= (3, 9):
|
||||
def removeprefix(self, __prefix: str) -> str: ...
|
||||
def removesuffix(self, __suffix: str) -> str: ...
|
||||
|
||||
def rfind(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
|
||||
def rindex(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
|
||||
def rjust(self, __width: SupportsIndex, __fillchar: str = ...) -> str: ...
|
||||
@@ -462,6 +469,7 @@ class bytes(ByteString):
|
||||
def expandtabs(self, tabsize: SupportsIndex = ...) -> bytes: ...
|
||||
else:
|
||||
def expandtabs(self, tabsize: int = ...) -> bytes: ...
|
||||
|
||||
def find(
|
||||
self, __sub: bytes | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
|
||||
) -> int: ...
|
||||
@@ -469,6 +477,7 @@ class bytes(ByteString):
|
||||
def hex(self, sep: str | bytes = ..., bytes_per_sep: SupportsIndex = ...) -> str: ...
|
||||
else:
|
||||
def hex(self) -> str: ...
|
||||
|
||||
def index(
|
||||
self, __sub: bytes | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
|
||||
) -> int: ...
|
||||
@@ -476,6 +485,7 @@ class bytes(ByteString):
|
||||
def isalpha(self) -> bool: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def isascii(self) -> bool: ...
|
||||
|
||||
def isdigit(self) -> bool: ...
|
||||
def islower(self) -> bool: ...
|
||||
def isspace(self) -> bool: ...
|
||||
@@ -490,6 +500,7 @@ class bytes(ByteString):
|
||||
if sys.version_info >= (3, 9):
|
||||
def removeprefix(self, __prefix: bytes) -> bytes: ...
|
||||
def removesuffix(self, __suffix: bytes) -> bytes: ...
|
||||
|
||||
def rfind(
|
||||
self, __sub: bytes | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
|
||||
) -> int: ...
|
||||
@@ -562,6 +573,7 @@ class bytearray(MutableSequence[int], ByteString):
|
||||
def expandtabs(self, tabsize: SupportsIndex = ...) -> bytearray: ...
|
||||
else:
|
||||
def expandtabs(self, tabsize: int = ...) -> bytearray: ...
|
||||
|
||||
def extend(self, __iterable_of_ints: Iterable[SupportsIndex]) -> None: ...
|
||||
def find(
|
||||
self, __sub: bytes | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
|
||||
@@ -570,6 +582,7 @@ class bytearray(MutableSequence[int], ByteString):
|
||||
def hex(self, sep: str | bytes = ..., bytes_per_sep: SupportsIndex = ...) -> str: ...
|
||||
else:
|
||||
def hex(self) -> str: ...
|
||||
|
||||
def index(
|
||||
self, __sub: bytes | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
|
||||
) -> int: ...
|
||||
@@ -578,6 +591,7 @@ class bytearray(MutableSequence[int], ByteString):
|
||||
def isalpha(self) -> bool: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def isascii(self) -> bool: ...
|
||||
|
||||
def isdigit(self) -> bool: ...
|
||||
def islower(self) -> bool: ...
|
||||
def isspace(self) -> bool: ...
|
||||
@@ -591,6 +605,7 @@ class bytearray(MutableSequence[int], ByteString):
|
||||
if sys.version_info >= (3, 9):
|
||||
def removeprefix(self, __prefix: bytes) -> bytearray: ...
|
||||
def removesuffix(self, __suffix: bytes) -> bytearray: ...
|
||||
|
||||
def replace(self, __old: bytes, __new: bytes, __count: SupportsIndex = ...) -> bytearray: ...
|
||||
def rfind(
|
||||
self, __sub: bytes | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
|
||||
@@ -691,9 +706,11 @@ class memoryview(Sized, Sequence[int]):
|
||||
def tobytes(self, order: Literal["C", "F", "A"] | None = ...) -> bytes: ...
|
||||
else:
|
||||
def tobytes(self) -> bytes: ...
|
||||
|
||||
def tolist(self) -> list[int]: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def toreadonly(self) -> memoryview: ...
|
||||
|
||||
def release(self) -> None: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def hex(self, sep: str | bytes = ..., bytes_per_sep: SupportsIndex = ...) -> str: ...
|
||||
@@ -1506,6 +1523,7 @@ class zip(Iterator[_T_co], Generic[_T_co]):
|
||||
__iter6: Iterable[Any],
|
||||
*iterables: Iterable[Any],
|
||||
) -> zip[tuple[Any, ...]]: ...
|
||||
|
||||
def __iter__(self) -> Iterator[_T_co]: ...
|
||||
def __next__(self) -> _T_co: ...
|
||||
|
||||
@@ -1679,6 +1697,7 @@ if sys.version_info >= (3, 10):
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
_SplitCondition = type[BaseException] | tuple[type[BaseException], ...] | Callable[[BaseException], bool]
|
||||
|
||||
class BaseExceptionGroup(BaseException):
|
||||
def __new__(cls, __message: str, __exceptions: Sequence[BaseException]) -> BaseExceptionGroup | ExceptionGroup: ...
|
||||
@property
|
||||
@@ -1688,6 +1707,7 @@ if sys.version_info >= (3, 11):
|
||||
def subgroup(self: Self, __condition: _SplitCondition) -> Self | None: ...
|
||||
def split(self: Self, __condition: _SplitCondition) -> tuple[Self | None, Self | None]: ...
|
||||
def derive(self: Self, __excs: Sequence[BaseException]) -> Self: ...
|
||||
|
||||
class ExceptionGroup(BaseExceptionGroup, Exception):
|
||||
def __new__(cls, __message: str, __exceptions: Sequence[Exception]) -> ExceptionGroup: ...
|
||||
@property
|
||||
|
||||
@@ -116,6 +116,7 @@ class BZ2File(BaseStream, IO[bytes]):
|
||||
buffering: Any | None = ...,
|
||||
compresslevel: int = ...,
|
||||
) -> None: ...
|
||||
|
||||
def read(self, size: int | None = ...) -> bytes: ...
|
||||
def read1(self, size: int = ...) -> bytes: ...
|
||||
def readline(self, size: SupportsIndex = ...) -> bytes: ... # type: ignore[override]
|
||||
|
||||
@@ -142,6 +142,7 @@ class UserString(Sequence[str]):
|
||||
def encode(self: UserString, encoding: str | None = ..., errors: str | None = ...) -> bytes: ...
|
||||
else:
|
||||
def encode(self: Self, encoding: str | None = ..., errors: str | None = ...) -> Self: ...
|
||||
|
||||
def endswith(self, suffix: str | tuple[str, ...], start: int | None = ..., end: int | None = ...) -> bool: ...
|
||||
def expandtabs(self: Self, tabsize: int = ...) -> Self: ...
|
||||
def find(self, sub: str | UserString, start: int = ..., end: int = ...) -> int: ...
|
||||
@@ -161,6 +162,7 @@ class UserString(Sequence[str]):
|
||||
def isupper(self) -> bool: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def isascii(self) -> bool: ...
|
||||
|
||||
def join(self, seq: Iterable[str]) -> str: ...
|
||||
def ljust(self: Self, width: int, *args: Any) -> Self: ...
|
||||
def lower(self: Self) -> Self: ...
|
||||
@@ -175,6 +177,7 @@ class UserString(Sequence[str]):
|
||||
if sys.version_info >= (3, 9):
|
||||
def removeprefix(self: Self, __prefix: str | UserString) -> Self: ...
|
||||
def removesuffix(self: Self, __suffix: str | UserString) -> Self: ...
|
||||
|
||||
def replace(self: Self, old: str | UserString, new: str | UserString, maxsplit: int = ...) -> Self: ...
|
||||
def rfind(self, sub: str | UserString, start: int = ..., end: int = ...) -> int: ...
|
||||
def rindex(self, sub: str | UserString, start: int = ..., end: int = ...) -> int: ...
|
||||
|
||||
@@ -63,6 +63,7 @@ class Executor:
|
||||
def submit(self, __fn: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> Future[_T]: ...
|
||||
else:
|
||||
def submit(self, fn: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> Future[_T]: ...
|
||||
|
||||
def map(
|
||||
self, fn: Callable[..., _T], *iterables: Iterable[Any], timeout: float | None = ..., chunksize: int = ...
|
||||
) -> Iterator[_T]: ...
|
||||
@@ -70,6 +71,7 @@ class Executor:
|
||||
def shutdown(self, wait: bool = ..., *, cancel_futures: bool = ...) -> None: ...
|
||||
else:
|
||||
def shutdown(self, wait: bool = ...) -> None: ...
|
||||
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> bool | None: ...
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ if sys.version_info >= (3, 7):
|
||||
def __init__(
|
||||
self, max_size: int | None = ..., *, ctx: BaseContext, pending_work_items: dict[int, _WorkItem[Any]]
|
||||
) -> None: ...
|
||||
|
||||
def _on_queue_feeder_error(self, e: Exception, obj: _CallItem) -> None: ...
|
||||
|
||||
def _get_chunks(*iterables: Any, chunksize: int) -> Generator[tuple[Any, ...], None, None]: ...
|
||||
@@ -130,6 +131,7 @@ def _chain_from_iterable_of_lists(iterable: Iterable[MutableSequence[Any]]) -> A
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from ._base import BrokenExecutor
|
||||
|
||||
class BrokenProcessPool(BrokenExecutor): ...
|
||||
|
||||
else:
|
||||
@@ -163,4 +165,5 @@ class ProcessPoolExecutor(Executor):
|
||||
def __init__(self, max_workers: int | None = ...) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def _start_executor_manager_thread(self) -> None: ...
|
||||
|
||||
def _adjust_process_count(self) -> None: ...
|
||||
|
||||
@@ -41,6 +41,7 @@ else:
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from ._base import BrokenExecutor
|
||||
|
||||
class BrokenThreadPool(BrokenExecutor): ...
|
||||
|
||||
class ThreadPoolExecutor(Executor):
|
||||
@@ -67,6 +68,7 @@ class ThreadPoolExecutor(Executor):
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, max_workers: int | None = ..., thread_name_prefix: str = ...) -> None: ...
|
||||
|
||||
def _adjust_thread_count(self) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def _initializer_failed(self) -> None: ...
|
||||
|
||||
@@ -51,8 +51,10 @@ def contextmanager(func: Callable[_P, Iterator[_T_co]]) -> Callable[_P, _Generat
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
_AF = TypeVar("_AF", bound=Callable[..., Awaitable[Any]])
|
||||
|
||||
class AsyncContextDecorator:
|
||||
def __call__(self, func: _AF) -> _AF: ...
|
||||
|
||||
class _AsyncGeneratorContextManager(AbstractAsyncContextManager[_T_co], AsyncContextDecorator, Generic[_T_co]):
|
||||
# __init__ and these attributes are actually defined in the base class _GeneratorContextManagerBase,
|
||||
# which is more trouble than it's worth to include in the stub (see #6676)
|
||||
@@ -85,6 +87,7 @@ if sys.version_info >= (3, 10):
|
||||
class _SupportsAclose(Protocol):
|
||||
def aclose(self) -> Awaitable[object]: ...
|
||||
_SupportsAcloseT = TypeVar("_SupportsAcloseT", bound=_SupportsAclose)
|
||||
|
||||
class aclosing(AbstractAsyncContextManager[_SupportsAcloseT]):
|
||||
def __init__(self, thing: _SupportsAcloseT) -> None: ...
|
||||
|
||||
@@ -115,6 +118,7 @@ class ExitStack(AbstractContextManager[ExitStack]):
|
||||
if sys.version_info >= (3, 7):
|
||||
_ExitCoroFunc = Callable[[Optional[type[BaseException]], Optional[BaseException], Optional[TracebackType]], Awaitable[bool]]
|
||||
_ACM_EF = TypeVar("_ACM_EF", AbstractAsyncContextManager[Any], _ExitCoroFunc)
|
||||
|
||||
class AsyncExitStack(AbstractAsyncContextManager[AsyncExitStack]):
|
||||
def __init__(self) -> None: ...
|
||||
def enter_context(self, cm: AbstractContextManager[_T]) -> _T: ...
|
||||
@@ -156,6 +160,7 @@ elif sys.version_info >= (3, 7):
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
_T_fd_or_any_path = TypeVar("_T_fd_or_any_path", bound=int | StrOrBytesPath)
|
||||
|
||||
class chdir(AbstractContextManager[None], Generic[_T_fd_or_any_path]):
|
||||
path: _T_fd_or_any_path
|
||||
def __init__(self, path: _T_fd_or_any_path) -> None: ...
|
||||
|
||||
@@ -15,4 +15,5 @@ if sys.platform != "win32":
|
||||
def mksalt(method: _Method | None = ..., *, rounds: int | None = ...) -> str: ...
|
||||
else:
|
||||
def mksalt(method: _Method | None = ...) -> str: ...
|
||||
|
||||
def crypt(word: str, salt: str | _Method | None = ...) -> str: ...
|
||||
|
||||
@@ -98,6 +98,7 @@ class DictWriter(Generic[_T]):
|
||||
def writeheader(self) -> Any: ...
|
||||
else:
|
||||
def writeheader(self) -> None: ...
|
||||
|
||||
def writerow(self, rowdict: Mapping[_T, Any]) -> Any: ...
|
||||
def writerows(self, rowdicts: Iterable[Mapping[_T, Any]]) -> None: ...
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ class CDLL:
|
||||
def __init__(
|
||||
self, name: str | None, mode: int = ..., handle: int | None = ..., use_errno: bool = ..., use_last_error: bool = ...
|
||||
) -> None: ...
|
||||
|
||||
def __getattr__(self, name: str) -> _NamedFuncPointer: ...
|
||||
def __getitem__(self, name: str) -> _NamedFuncPointer: ...
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ if sys.platform != "win32":
|
||||
from _curses import _CursesWindow
|
||||
|
||||
version: str
|
||||
|
||||
class _Curses_Panel: # type is <class '_curses_panel.curses panel'> (note the space in the class name)
|
||||
def above(self) -> _Curses_Panel: ...
|
||||
def below(self) -> _Curses_Panel: ...
|
||||
@@ -17,6 +18,7 @@ if sys.platform != "win32":
|
||||
def top(self) -> None: ...
|
||||
def userptr(self) -> object: ...
|
||||
def window(self) -> _CursesWindow: ...
|
||||
|
||||
def bottom_panel() -> _Curses_Panel: ...
|
||||
def new_panel(__win: _CursesWindow) -> _Curses_Panel: ...
|
||||
def top_panel() -> _Curses_Panel: ...
|
||||
|
||||
@@ -4,6 +4,7 @@ from typing import Callable
|
||||
if sys.platform != "win32":
|
||||
from _curses import _CursesWindow
|
||||
def rectangle(win: _CursesWindow, uly: int, ulx: int, lry: int, lrx: int) -> None: ...
|
||||
|
||||
class Textbox:
|
||||
stripspaces: bool
|
||||
def __init__(self, win: _CursesWindow, insert_mode: bool = ...) -> None: ...
|
||||
|
||||
@@ -49,6 +49,7 @@ class date:
|
||||
if sys.version_info >= (3, 8):
|
||||
@classmethod
|
||||
def fromisocalendar(cls: type[Self], year: int, week: int, day: int) -> Self: ...
|
||||
|
||||
@property
|
||||
def year(self) -> int: ...
|
||||
@property
|
||||
@@ -85,6 +86,7 @@ class date:
|
||||
def __sub__(self, __other: datetime) -> NoReturn: ...
|
||||
@overload
|
||||
def __sub__(self, __other: date) -> timedelta: ...
|
||||
|
||||
def __hash__(self) -> int: ...
|
||||
def weekday(self) -> int: ...
|
||||
def isoweekday(self) -> int: ...
|
||||
@@ -128,6 +130,7 @@ class time:
|
||||
if sys.version_info >= (3, 7):
|
||||
@classmethod
|
||||
def fromisoformat(cls: type[Self], __time_string: str) -> Self: ...
|
||||
|
||||
def strftime(self, __format: str) -> str: ...
|
||||
def __format__(self, __fmt: str) -> str: ...
|
||||
def utcoffset(self) -> timedelta | None: ...
|
||||
@@ -240,6 +243,7 @@ class datetime(date):
|
||||
@overload
|
||||
@classmethod
|
||||
def now(cls, tz: _tzinfo) -> datetime: ...
|
||||
|
||||
@classmethod
|
||||
def utcnow(cls: type[Self]) -> Self: ...
|
||||
@classmethod
|
||||
@@ -247,6 +251,7 @@ class datetime(date):
|
||||
if sys.version_info >= (3, 7):
|
||||
@classmethod
|
||||
def fromisoformat(cls: type[Self], __date_string: str) -> Self: ...
|
||||
|
||||
def timestamp(self) -> float: ...
|
||||
def utctimetuple(self) -> struct_time: ...
|
||||
def date(self) -> _date: ...
|
||||
@@ -269,6 +274,7 @@ class datetime(date):
|
||||
def astimezone(self: Self, tz: _tzinfo | None = ...) -> Self: ...
|
||||
else:
|
||||
def astimezone(self, tz: _tzinfo | None = ...) -> datetime: ...
|
||||
|
||||
def ctime(self) -> str: ...
|
||||
def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ...
|
||||
@classmethod
|
||||
|
||||
@@ -22,6 +22,7 @@ class SequenceMatcher(Generic[_T]):
|
||||
def find_longest_match(self, alo: int = ..., ahi: int | None = ..., blo: int = ..., bhi: int | None = ...) -> Match: ...
|
||||
else:
|
||||
def find_longest_match(self, alo: int, ahi: int, blo: int, bhi: int) -> Match: ...
|
||||
|
||||
def get_matching_blocks(self) -> list[Match]: ...
|
||||
def get_opcodes(self) -> list[tuple[str, int, int, int, int]]: ...
|
||||
def get_grouped_opcodes(self, n: int = ...) -> Iterable[list[tuple[str, int, int, int, int]]]: ...
|
||||
|
||||
@@ -5,6 +5,7 @@ from ..cmd import Command
|
||||
|
||||
if sys.platform == "win32":
|
||||
from msilib import Dialog
|
||||
|
||||
class PyDialog(Dialog):
|
||||
def __init__(self, *args, **kw) -> None: ...
|
||||
def title(self, title) -> None: ...
|
||||
@@ -12,6 +13,7 @@ if sys.platform == "win32":
|
||||
def cancel(self, title, next, name: str = ..., active: int = ...): ...
|
||||
def next(self, title, next, name: str = ..., active: int = ...): ...
|
||||
def xbutton(self, name, title, next, xpos): ...
|
||||
|
||||
class bdist_msi(Command):
|
||||
description: str
|
||||
user_options: Any
|
||||
|
||||
@@ -312,8 +312,10 @@ if sys.version_info >= (3, 8):
|
||||
token_type: str
|
||||
as_ew_allowed: bool
|
||||
def fold(self, policy: Policy) -> str: ...
|
||||
|
||||
class MessageID(MsgID):
|
||||
token_type: str
|
||||
|
||||
class InvalidMessageID(MessageID):
|
||||
token_type: str
|
||||
|
||||
|
||||
@@ -132,6 +132,7 @@ class ContentTransferEncodingHeader:
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from email._header_value_parser import MessageID
|
||||
|
||||
class MessageIDHeader:
|
||||
max_count: ClassVar[Literal[1]]
|
||||
@classmethod
|
||||
|
||||
@@ -46,6 +46,7 @@ class EnumMeta(ABCMeta):
|
||||
def __new__(metacls: type[Self], cls: str, bases: tuple[type, ...], classdict: _EnumDict, **kwds: Any) -> Self: ... # type: ignore
|
||||
else:
|
||||
def __new__(metacls: type[Self], cls: str, bases: tuple[type, ...], classdict: _EnumDict) -> Self: ... # type: ignore
|
||||
|
||||
def __iter__(self: type[_T]) -> Iterator[_T]: ...
|
||||
def __reversed__(self: type[_T]) -> Iterator[_T]: ...
|
||||
def __contains__(self: type[Any], member: object) -> bool: ...
|
||||
@@ -127,6 +128,7 @@ class IntEnum(int, Enum):
|
||||
else:
|
||||
@types.DynamicClassAttribute
|
||||
def value(self) -> int: ...
|
||||
|
||||
def __new__(cls: type[Self], value: int | Self) -> Self: ...
|
||||
|
||||
def unique(enumeration: _S) -> _S: ...
|
||||
@@ -142,6 +144,7 @@ class auto(IntFlag):
|
||||
else:
|
||||
@types.DynamicClassAttribute
|
||||
def value(self) -> Any: ...
|
||||
|
||||
def __new__(cls: type[Self]) -> Self: ...
|
||||
|
||||
class Flag(Enum):
|
||||
@@ -157,6 +160,7 @@ class Flag(Enum):
|
||||
def name(self) -> str | None: ... # type: ignore[override]
|
||||
@types.DynamicClassAttribute
|
||||
def value(self) -> int: ...
|
||||
|
||||
def __contains__(self: _T, other: _T) -> bool: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __or__(self: Self, other: Self) -> Self: ...
|
||||
@@ -179,6 +183,7 @@ if sys.version_info >= (3, 11):
|
||||
_value_: str
|
||||
@property
|
||||
def value(self) -> str: ...
|
||||
|
||||
class FlagBoundary(StrEnum):
|
||||
STRICT: str
|
||||
CONFORM: str
|
||||
@@ -188,6 +193,7 @@ if sys.version_info >= (3, 11):
|
||||
CONFORM = FlagBoundary.CONFORM
|
||||
EJECT = FlagBoundary.EJECT
|
||||
KEEP = FlagBoundary.KEEP
|
||||
|
||||
class property(types.DynamicClassAttribute):
|
||||
def __set_name__(self, ownerclass: type[Enum], name: str) -> None: ...
|
||||
name: str
|
||||
|
||||
@@ -79,6 +79,7 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]):
|
||||
mode: str = ...,
|
||||
openhook: Callable[[StrOrBytesPath, str], IO[AnyStr]] = ...,
|
||||
) -> None: ...
|
||||
|
||||
def __del__(self) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
@@ -87,6 +88,7 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]):
|
||||
def __next__(self) -> AnyStr: ...
|
||||
if sys.version_info < (3, 11):
|
||||
def __getitem__(self, i: int) -> AnyStr: ...
|
||||
|
||||
def nextfile(self) -> None: ...
|
||||
def readline(self) -> AnyStr: ...
|
||||
def filename(self) -> str: ...
|
||||
|
||||
@@ -31,6 +31,7 @@ class Fraction(Rational):
|
||||
def limit_denominator(self, max_denominator: int = ...) -> Fraction: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def as_integer_ratio(self) -> tuple[int, int]: ...
|
||||
|
||||
@property
|
||||
def numerator(self) -> int: ...
|
||||
@property
|
||||
|
||||
@@ -62,6 +62,7 @@ class FTP:
|
||||
timeout: float = ...,
|
||||
source_address: tuple[str, int] | None = ...,
|
||||
) -> None: ...
|
||||
|
||||
def connect(
|
||||
self, host: str = ..., port: int = ..., timeout: float = ..., source_address: tuple[str, int] | None = ...
|
||||
) -> str: ...
|
||||
|
||||
@@ -106,6 +106,7 @@ if sys.version_info >= (3, 8):
|
||||
@overload
|
||||
def register(self, cls: type[Any], method: Callable[..., _T]) -> Callable[..., _T]: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> _T: ...
|
||||
|
||||
class cached_property(Generic[_T]):
|
||||
func: Callable[[Any], _T]
|
||||
attrname: str | None
|
||||
|
||||
@@ -14,11 +14,13 @@ class NullTranslations:
|
||||
if sys.version_info >= (3, 8):
|
||||
def pgettext(self, context: str, message: str) -> str: ...
|
||||
def npgettext(self, context: str, msgid1: str, msgid2: str, n: int) -> str: ...
|
||||
|
||||
def info(self) -> Any: ...
|
||||
def charset(self) -> Any: ...
|
||||
if sys.version_info < (3, 11):
|
||||
def output_charset(self) -> Any: ...
|
||||
def set_output_charset(self, charset: str) -> None: ...
|
||||
|
||||
def install(self, names: Container[str] | None = ...) -> None: ...
|
||||
|
||||
class GNUTranslations(NullTranslations):
|
||||
|
||||
@@ -14,6 +14,7 @@ if sys.platform != "win32":
|
||||
def gr_gid(self) -> int: ...
|
||||
@property
|
||||
def gr_mem(self) -> list[str]: ...
|
||||
|
||||
def getgrall() -> list[struct_group]: ...
|
||||
def getgrgid(id: int) -> struct_group: ...
|
||||
def getgrnam(name: str) -> struct_group: ...
|
||||
|
||||
@@ -153,6 +153,7 @@ class HTTPConnection:
|
||||
def __init__(
|
||||
self, host: str, port: int | None = ..., timeout: float | None = ..., source_address: tuple[str, int] | None = ...
|
||||
) -> None: ...
|
||||
|
||||
def request(
|
||||
self, method: str, url: str, body: _DataType | None = ..., headers: Mapping[str, str] = ..., *, encode_chunked: bool = ...
|
||||
) -> None: ...
|
||||
|
||||
@@ -35,6 +35,7 @@ class FileCookieJar(CookieJar):
|
||||
def __init__(self, filename: StrPath | None = ..., delayload: bool = ..., policy: CookiePolicy | None = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self, filename: str | None = ..., delayload: bool = ..., policy: CookiePolicy | None = ...) -> None: ...
|
||||
|
||||
def save(self, filename: str | None = ..., ignore_discard: bool = ..., ignore_expires: bool = ...) -> None: ...
|
||||
def load(self, filename: str | None = ..., ignore_discard: bool = ..., ignore_expires: bool = ...) -> None: ...
|
||||
def revert(self, filename: str | None = ..., ignore_discard: bool = ..., ignore_expires: bool = ...) -> None: ...
|
||||
@@ -100,6 +101,7 @@ class DefaultCookiePolicy(CookiePolicy):
|
||||
strict_ns_set_initial_dollar: bool = ...,
|
||||
strict_ns_set_path: bool = ...,
|
||||
) -> None: ...
|
||||
|
||||
def blocked_domains(self) -> tuple[str, ...]: ...
|
||||
def set_blocked_domains(self, blocked_domains: Sequence[str]) -> None: ...
|
||||
def is_blocked(self, domain: str) -> bool: ...
|
||||
|
||||
@@ -27,6 +27,7 @@ class Morsel(dict[str, Any], Generic[_T]):
|
||||
def set(self, key: str, val: str, coded_val: _T) -> None: ...
|
||||
else:
|
||||
def set(self, key: str, val: str, coded_val: _T, LegalChars: str = ...) -> None: ...
|
||||
|
||||
def setdefault(self, key: str, val: str | None = ...) -> str: ...
|
||||
# The dict update can also get a keywords argument so this is incompatible
|
||||
@overload # type: ignore[override]
|
||||
|
||||
@@ -60,6 +60,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, request: bytes, client_address: tuple[str, int], server: socketserver.BaseServer) -> None: ...
|
||||
|
||||
def do_GET(self) -> None: ...
|
||||
def do_HEAD(self) -> None: ...
|
||||
def send_head(self) -> io.BytesIO | BinaryIO | None: ... # undocumented
|
||||
|
||||
@@ -40,6 +40,7 @@ class IMAP4:
|
||||
else:
|
||||
def __init__(self, host: str = ..., port: int = ...) -> None: ...
|
||||
def open(self, host: str = ..., port: int = ...) -> None: ...
|
||||
|
||||
def __getattr__(self, attr: str) -> Any: ...
|
||||
host: str
|
||||
port: int
|
||||
@@ -96,6 +97,7 @@ class IMAP4:
|
||||
def unsubscribe(self, mailbox: str) -> _CommandResults: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def unselect(self) -> _CommandResults: ...
|
||||
|
||||
def xatom(self, name: str, *args: str) -> _CommandResults: ...
|
||||
def print_log(self) -> None: ...
|
||||
|
||||
@@ -130,6 +132,7 @@ class IMAP4_SSL(IMAP4):
|
||||
def open(self, host: str = ..., port: int | None = ..., timeout: float | None = ...) -> None: ...
|
||||
else:
|
||||
def open(self, host: str = ..., port: int | None = ...) -> None: ...
|
||||
|
||||
def read(self, size: int) -> bytes: ...
|
||||
def readline(self) -> bytes: ...
|
||||
def send(self, data: bytes) -> None: ...
|
||||
@@ -151,6 +154,7 @@ class IMAP4_stream(IMAP4):
|
||||
def open(self, host: str | None = ..., port: int | None = ..., timeout: float | None = ...) -> None: ...
|
||||
else:
|
||||
def open(self, host: str | None = ..., port: int | None = ...) -> None: ...
|
||||
|
||||
def read(self, size: int) -> bytes: ...
|
||||
def readline(self) -> bytes: ...
|
||||
def send(self, data: bytes) -> None: ...
|
||||
|
||||
@@ -91,6 +91,7 @@ if sys.version_info >= (3, 7):
|
||||
else:
|
||||
@abstractmethod
|
||||
def is_resource(self, name: str) -> bool: ...
|
||||
|
||||
@abstractmethod
|
||||
def contents(self) -> Iterator[str]: ...
|
||||
|
||||
@@ -173,6 +174,7 @@ if sys.version_info >= (3, 9):
|
||||
def read_bytes(self) -> bytes: ...
|
||||
@abstractmethod
|
||||
def read_text(self, encoding: str | None = ...) -> str: ...
|
||||
|
||||
class TraversableResources(ResourceReader):
|
||||
@abstractmethod
|
||||
def files(self) -> Traversable: ...
|
||||
|
||||
@@ -82,6 +82,7 @@ class FrozenImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader):
|
||||
else:
|
||||
@classmethod
|
||||
def create_module(cls, spec: ModuleSpec) -> types.ModuleType | None: ...
|
||||
|
||||
@staticmethod
|
||||
def exec_module(module: types.ModuleType) -> None: ...
|
||||
|
||||
@@ -106,6 +107,7 @@ class PathFinder:
|
||||
elif sys.version_info >= (3, 8):
|
||||
@classmethod
|
||||
def find_distributions(cls, context: DistributionFinder.Context = ...) -> Iterable[PathDistribution]: ...
|
||||
|
||||
@classmethod
|
||||
def find_spec(
|
||||
cls, fullname: str, path: Sequence[bytes | str] | None = ..., target: types.ModuleType | None = ...
|
||||
|
||||
@@ -15,10 +15,12 @@ if sys.version_info >= (3, 10):
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
class PackageNotFoundError(ModuleNotFoundError): ...
|
||||
|
||||
class _EntryPointBase(NamedTuple):
|
||||
name: str
|
||||
value: str
|
||||
group: str
|
||||
|
||||
class EntryPoint(_EntryPointBase):
|
||||
pattern: ClassVar[Pattern[str]]
|
||||
def load(self) -> Any: ... # Callable[[], Any] or an importable module
|
||||
@@ -32,6 +34,7 @@ if sys.version_info >= (3, 8):
|
||||
if sys.version_info >= (3, 10):
|
||||
dist: ClassVar[Distribution | None]
|
||||
def matches(self, **params: Any) -> bool: ... # undocumented
|
||||
|
||||
class PackagePath(pathlib.PurePosixPath):
|
||||
def read_text(self, encoding: str = ...) -> str: ...
|
||||
def read_binary(self) -> bytes: ...
|
||||
@@ -40,10 +43,12 @@ if sys.version_info >= (3, 8):
|
||||
hash: FileHash | None
|
||||
size: int | None
|
||||
dist: Distribution
|
||||
|
||||
class FileHash:
|
||||
mode: str
|
||||
value: str
|
||||
def __init__(self, spec: str) -> None: ...
|
||||
|
||||
class Distribution:
|
||||
@abc.abstractmethod
|
||||
def read_text(self, filename: str) -> str | None: ...
|
||||
@@ -74,24 +79,29 @@ if sys.version_info >= (3, 8):
|
||||
if sys.version_info >= (3, 10):
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
|
||||
class DistributionFinder(MetaPathFinder):
|
||||
class Context:
|
||||
name: str | None
|
||||
def __init__(self, *, name: str | None = ..., path: list[str] = ..., **kwargs: Any) -> None: ...
|
||||
@property
|
||||
def path(self) -> list[str]: ...
|
||||
|
||||
@abc.abstractmethod
|
||||
def find_distributions(self, context: DistributionFinder.Context = ...) -> Iterable[Distribution]: ...
|
||||
|
||||
class MetadataPathFinder(DistributionFinder):
|
||||
@classmethod
|
||||
def find_distributions(cls, context: DistributionFinder.Context = ...) -> Iterable[PathDistribution]: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
# Yes, this is an instance method that has argumend named "cls"
|
||||
def invalidate_caches(cls) -> None: ... # type: ignore
|
||||
|
||||
class PathDistribution(Distribution):
|
||||
def __init__(self, path: Path) -> None: ...
|
||||
def read_text(self, filename: StrPath) -> str: ...
|
||||
def locate_file(self, path: StrPath) -> PathLike[str]: ...
|
||||
|
||||
def distribution(distribution_name: str) -> Distribution: ...
|
||||
@overload
|
||||
def distributions(*, context: DistributionFinder.Context) -> Iterable[Distribution]: ...
|
||||
|
||||
@@ -90,6 +90,7 @@ class _BaseNetwork(_IPAddressBase, Container[_A], Iterable[_A], Generic[_A]):
|
||||
if sys.version_info >= (3, 7):
|
||||
def subnet_of(self: Self, other: Self) -> bool: ...
|
||||
def supernet_of(self: Self, other: Self) -> bool: ...
|
||||
|
||||
def subnets(self: Self, prefixlen_diff: int = ..., new_prefix: int | None = ...) -> Iterator[Self]: ...
|
||||
def supernet(self: Self, prefixlen_diff: int = ..., new_prefix: int | None = ...) -> Self: ...
|
||||
@property
|
||||
|
||||
@@ -58,6 +58,7 @@ class accumulate(Iterator[_T], Generic[_T]):
|
||||
def __init__(self, iterable: Iterable[_S], func: Callable[[_T, _S], _T], *, initial: _T | None = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self, iterable: Iterable[_T], func: Callable[[_T, _T], _T] | None = ...) -> None: ...
|
||||
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
def __next__(self) -> _T: ...
|
||||
|
||||
|
||||
@@ -227,6 +227,7 @@ class Logger(Filterer):
|
||||
def findCaller(self, stack_info: bool = ..., stacklevel: int = ...) -> tuple[str, int, str, str | None]: ...
|
||||
else:
|
||||
def findCaller(self, stack_info: bool = ...) -> tuple[str, int, str, str | None]: ...
|
||||
|
||||
def handle(self, record: LogRecord) -> None: ...
|
||||
def makeRecord(
|
||||
self,
|
||||
@@ -301,6 +302,7 @@ class Formatter:
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, fmt: str | None = ..., datefmt: str | None = ..., style: _FormatStyle = ...) -> None: ...
|
||||
|
||||
def format(self, record: LogRecord) -> str: ...
|
||||
def formatTime(self, record: LogRecord, datefmt: str | None = ...) -> str: ...
|
||||
def formatException(self, ei: _SysExcInfoType) -> str: ...
|
||||
@@ -372,6 +374,7 @@ class LoggerAdapter(Generic[_L]):
|
||||
else:
|
||||
extra: Mapping[str, object]
|
||||
def __init__(self, logger: _L, extra: Mapping[str, object]) -> None: ...
|
||||
|
||||
def process(self, msg: Any, kwargs: MutableMapping[str, Any]) -> tuple[Any, MutableMapping[str, Any]]: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def debug(
|
||||
@@ -529,6 +532,7 @@ class LoggerAdapter(Generic[_L]):
|
||||
extra: Mapping[str, object] | None = ...,
|
||||
**kwargs: object,
|
||||
) -> None: ...
|
||||
|
||||
def isEnabledFor(self, level: int) -> bool: ...
|
||||
def getEffectiveLevel(self) -> int: ...
|
||||
def setLevel(self, level: _Level) -> None: ...
|
||||
@@ -733,6 +737,7 @@ class FileHandler(StreamHandler[TextIOWrapper]):
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, filename: StrPath, mode: str = ..., encoding: str | None = ..., delay: bool = ...) -> None: ...
|
||||
|
||||
def _open(self) -> TextIOWrapper: ... # undocumented
|
||||
|
||||
class NullHandler(Handler): ...
|
||||
@@ -760,9 +765,11 @@ class PercentStyle: # undocumented
|
||||
def __init__(self, fmt: str, *, defaults: Mapping[str, Any] | None = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self, fmt: str) -> None: ...
|
||||
|
||||
def usesTime(self) -> bool: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def validate(self) -> None: ...
|
||||
|
||||
def format(self, record: Any) -> str: ...
|
||||
|
||||
class StrFormatStyle(PercentStyle): # undocumented
|
||||
|
||||
@@ -29,6 +29,7 @@ class WatchedFileHandler(FileHandler):
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, filename: StrPath, mode: str = ..., encoding: str | None = ..., delay: bool = ...) -> None: ...
|
||||
|
||||
def _statstream(self) -> None: ... # undocumented
|
||||
def reopenIfNeeded(self) -> None: ...
|
||||
|
||||
@@ -41,6 +42,7 @@ class BaseRotatingHandler(FileHandler):
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, filename: StrPath, mode: str, encoding: str | None = ..., delay: bool = ...) -> None: ...
|
||||
|
||||
def rotation_filename(self, default_name: str) -> str: ...
|
||||
def rotate(self, source: str, dest: str) -> None: ...
|
||||
|
||||
@@ -68,6 +70,7 @@ class RotatingFileHandler(BaseRotatingHandler):
|
||||
encoding: str | None = ...,
|
||||
delay: bool = ...,
|
||||
) -> None: ...
|
||||
|
||||
def doRollover(self) -> None: ...
|
||||
def shouldRollover(self, record: LogRecord) -> int: ... # undocumented
|
||||
|
||||
@@ -106,6 +109,7 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
|
||||
utc: bool = ...,
|
||||
atTime: datetime.datetime | None = ...,
|
||||
) -> None: ...
|
||||
|
||||
def doRollover(self) -> None: ...
|
||||
def shouldRollover(self, record: LogRecord) -> int: ... # undocumented
|
||||
def computeRollover(self, currentTime: int) -> int: ... # undocumented
|
||||
@@ -250,6 +254,7 @@ class QueueHandler(Handler):
|
||||
else:
|
||||
queue: Queue[Any] # undocumented
|
||||
def __init__(self, queue: Queue[Any]) -> None: ...
|
||||
|
||||
def prepare(self, record: LogRecord) -> Any: ...
|
||||
def enqueue(self, record: LogRecord) -> None: ...
|
||||
|
||||
@@ -264,6 +269,7 @@ class QueueListener:
|
||||
else:
|
||||
queue: Queue[Any] # undocumented
|
||||
def __init__(self, queue: Queue[Any], *handlers: Handler, respect_handler_level: bool = ...) -> None: ...
|
||||
|
||||
def dequeue(self, block: bool) -> LogRecord: ...
|
||||
def prepare(self, record: LogRecord) -> Any: ...
|
||||
def start(self) -> None: ...
|
||||
|
||||
@@ -32,6 +32,7 @@ class MimeTypes:
|
||||
def guess_type(self, url: StrPath, strict: bool = ...) -> tuple[str | None, str | None]: ...
|
||||
else:
|
||||
def guess_type(self, url: str, strict: bool = ...) -> tuple[str | None, str | None]: ...
|
||||
|
||||
def guess_all_extensions(self, type: str, strict: bool = ...) -> list[str]: ...
|
||||
def read(self, filename: str, strict: bool = ...) -> None: ...
|
||||
def readfp(self, fp: IO[str], strict: bool = ...) -> None: ...
|
||||
|
||||
@@ -34,11 +34,13 @@ class mmap(AbstractContextManager[mmap], Iterable[int], Sized):
|
||||
def __init__(
|
||||
self, fileno: int, length: int, flags: int = ..., prot: int = ..., access: int = ..., offset: int = ...
|
||||
) -> None: ...
|
||||
|
||||
def close(self) -> None: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def flush(self, offset: int = ..., size: int = ...) -> None: ...
|
||||
else:
|
||||
def flush(self, offset: int = ..., size: int = ...) -> int: ...
|
||||
|
||||
def move(self, dest: int, src: int, count: int) -> None: ...
|
||||
def read_byte(self) -> int: ...
|
||||
def readline(self) -> bytes: ...
|
||||
@@ -51,6 +53,7 @@ class mmap(AbstractContextManager[mmap], Iterable[int], Sized):
|
||||
closed: bool
|
||||
if sys.version_info >= (3, 8) and sys.platform != "win32":
|
||||
def madvise(self, option: int, start: int = ..., length: int = ...) -> None: ...
|
||||
|
||||
def find(self, sub: ReadableBuffer, start: int = ..., stop: int = ...) -> int: ...
|
||||
def rfind(self, sub: ReadableBuffer, start: int = ..., stop: int = ...) -> int: ...
|
||||
def read(self, n: int | None = ...) -> bytes: ...
|
||||
|
||||
@@ -46,6 +46,7 @@ class ModuleFinder:
|
||||
excludes: Container[str] = ...,
|
||||
replace_paths: Sequence[tuple[str, str]] = ...,
|
||||
) -> None: ...
|
||||
|
||||
def msg(self, level: int, str: str, *args: Any) -> None: ... # undocumented
|
||||
def msgin(self, *args: Any) -> None: ... # undocumented
|
||||
def msgout(self, *args: Any) -> None: ... # undocumented
|
||||
|
||||
@@ -22,6 +22,7 @@ if sys.platform == "win32":
|
||||
type_nullable: Literal[0x1000]
|
||||
type_key: Literal[0x2000]
|
||||
knownbits: Literal[0x3FFF]
|
||||
|
||||
class Table:
|
||||
|
||||
name: str
|
||||
@@ -30,7 +31,9 @@ if sys.platform == "win32":
|
||||
def add_field(self, index: int, name: str, type: int) -> None: ...
|
||||
def sql(self) -> str: ...
|
||||
def create(self, db: _Database) -> None: ...
|
||||
|
||||
class _Unspecified: ...
|
||||
|
||||
def change_sequence(
|
||||
seq: Sequence[tuple[str, str | None, int]],
|
||||
action: str,
|
||||
@@ -45,6 +48,7 @@ if sys.platform == "win32":
|
||||
def add_tables(db: _Database, module: ModuleType) -> None: ...
|
||||
def make_id(str: str) -> str: ...
|
||||
def gen_uuid() -> str: ...
|
||||
|
||||
class CAB:
|
||||
|
||||
name: str
|
||||
@@ -56,6 +60,7 @@ if sys.platform == "win32":
|
||||
def append(self, full: str, file: str, logical: str) -> tuple[int, str]: ...
|
||||
def commit(self, db: _Database) -> None: ...
|
||||
_directories: set[str]
|
||||
|
||||
class Directory:
|
||||
|
||||
db: _Database
|
||||
@@ -91,10 +96,12 @@ if sys.platform == "win32":
|
||||
def add_file(self, file: str, src: str | None = ..., version: str | None = ..., language: str | None = ...) -> str: ...
|
||||
def glob(self, pattern: str, exclude: Container[str] | None = ...) -> list[str]: ...
|
||||
def remove_pyc(self) -> None: ...
|
||||
|
||||
class Binary:
|
||||
|
||||
name: str
|
||||
def __init__(self, fname: str) -> None: ...
|
||||
|
||||
class Feature:
|
||||
|
||||
id: str
|
||||
@@ -111,6 +118,7 @@ if sys.platform == "win32":
|
||||
attributes: int = ...,
|
||||
) -> None: ...
|
||||
def set_current(self) -> None: ...
|
||||
|
||||
class Control:
|
||||
|
||||
dlg: Dialog
|
||||
@@ -119,12 +127,14 @@ if sys.platform == "win32":
|
||||
def event(self, event: str, argument: str, condition: str = ..., ordering: int | None = ...) -> None: ...
|
||||
def mapping(self, event: str, attribute: str) -> None: ...
|
||||
def condition(self, action: str, condition: str) -> None: ...
|
||||
|
||||
class RadioButtonGroup(Control):
|
||||
|
||||
property: str
|
||||
index: int
|
||||
def __init__(self, dlg: Dialog, name: str, property: str) -> None: ...
|
||||
def add(self, name: str, x: int, y: int, w: int, h: int, text: str, value: str | None = ...) -> None: ...
|
||||
|
||||
class Dialog:
|
||||
|
||||
db: _Database
|
||||
|
||||
@@ -15,6 +15,7 @@ class _ConnectionBase:
|
||||
def __init__(self, handle: SupportsIndex, readable: bool = ..., writable: bool = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self, handle: int, readable: bool = ..., writable: bool = ...) -> None: ...
|
||||
|
||||
@property
|
||||
def closed(self) -> bool: ... # undocumented
|
||||
@property
|
||||
|
||||
@@ -33,6 +33,7 @@ class BaseContext:
|
||||
if sys.version_info >= (3, 8):
|
||||
@staticmethod
|
||||
def parent_process() -> BaseProcess | None: ...
|
||||
|
||||
@staticmethod
|
||||
def active_children() -> list[BaseProcess]: ...
|
||||
def cpu_count(self) -> int: ...
|
||||
@@ -113,6 +114,7 @@ class BaseContext:
|
||||
def get_context(self, method: Literal["spawn"]) -> SpawnContext: ...
|
||||
@overload
|
||||
def get_context(self, method: str) -> BaseContext: ...
|
||||
|
||||
def get_start_method(self, allow_none: bool = ...) -> str: ...
|
||||
def set_start_method(self, method: str | None, force: bool = ...) -> None: ...
|
||||
@property
|
||||
@@ -140,20 +142,25 @@ if sys.platform != "win32":
|
||||
_start_method: str
|
||||
@staticmethod
|
||||
def _Popen(process_obj: BaseProcess) -> Any: ...
|
||||
|
||||
class SpawnProcess(BaseProcess):
|
||||
_start_method: str
|
||||
@staticmethod
|
||||
def _Popen(process_obj: BaseProcess) -> SpawnProcess: ...
|
||||
|
||||
class ForkServerProcess(BaseProcess):
|
||||
_start_method: str
|
||||
@staticmethod
|
||||
def _Popen(process_obj: BaseProcess) -> Any: ...
|
||||
|
||||
class ForkContext(BaseContext):
|
||||
_name: str
|
||||
Process: type[ForkProcess]
|
||||
|
||||
class SpawnContext(BaseContext):
|
||||
_name: str
|
||||
Process: type[SpawnProcess]
|
||||
|
||||
class ForkServerContext(BaseContext):
|
||||
_name: str
|
||||
Process: type[ForkServerProcess]
|
||||
@@ -163,6 +170,7 @@ else:
|
||||
_start_method: str
|
||||
@staticmethod
|
||||
def _Popen(process_obj: BaseProcess) -> Any: ...
|
||||
|
||||
class SpawnContext(BaseContext):
|
||||
_name: str
|
||||
Process: type[SpawnProcess]
|
||||
|
||||
@@ -113,6 +113,7 @@ class RemoteError(Exception): ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
class SharedMemoryServer(Server): ...
|
||||
|
||||
class SharedMemoryManager(BaseManager):
|
||||
def get_server(self) -> SharedMemoryServer: ...
|
||||
def SharedMemory(self, size: int) -> _SharedMemory: ...
|
||||
|
||||
@@ -24,6 +24,7 @@ class ApplyResult(Generic[_T]):
|
||||
callback: Callable[[_T], None] | None,
|
||||
error_callback: Callable[[BaseException], None] | None,
|
||||
) -> None: ...
|
||||
|
||||
def get(self, timeout: float | None = ...) -> _T: ...
|
||||
def wait(self, timeout: float | None = ...) -> None: ...
|
||||
def ready(self) -> bool: ...
|
||||
@@ -59,6 +60,7 @@ class IMapIterator(Iterator[_T]):
|
||||
def __init__(self, pool: Pool) -> None: ...
|
||||
else:
|
||||
def __init__(self, cache: dict[int, IMapIterator[Any]]) -> None: ...
|
||||
|
||||
def __iter__(self: Self) -> Self: ...
|
||||
def next(self, timeout: float | None = ...) -> _T: ...
|
||||
def __next__(self, timeout: float | None = ...) -> _T: ...
|
||||
|
||||
@@ -22,6 +22,7 @@ class BaseProcess:
|
||||
if sys.version_info >= (3, 7):
|
||||
def kill(self) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
def join(self, timeout: float | None = ...) -> None: ...
|
||||
def is_alive(self) -> bool: ...
|
||||
@property
|
||||
|
||||
@@ -30,6 +30,7 @@ class SimpleQueue(Generic[_T]):
|
||||
def __init__(self, *, ctx: Any = ...) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def close(self) -> None: ...
|
||||
|
||||
def empty(self) -> bool: ...
|
||||
def get(self) -> _T: ...
|
||||
def put(self, item: _T) -> None: ...
|
||||
|
||||
@@ -18,6 +18,7 @@ if sys.version_info >= (3, 8):
|
||||
def size(self) -> int: ...
|
||||
def close(self) -> None: ...
|
||||
def unlink(self) -> None: ...
|
||||
|
||||
class ShareableList(Generic[_SLT]):
|
||||
shm: SharedMemory
|
||||
def __init__(self, sequence: Iterable[_SLT] | None = ..., *, name: str | None = ...) -> None: ...
|
||||
|
||||
@@ -20,6 +20,7 @@ class Condition(AbstractContextManager[bool]):
|
||||
def notify(self, n: int = ...) -> None: ...
|
||||
else:
|
||||
def notify(self) -> None: ...
|
||||
|
||||
def notify_all(self) -> None: ...
|
||||
def wait(self, timeout: float | None = ...) -> bool: ...
|
||||
def wait_for(self, predicate: Callable[[], bool], timeout: float | None = ...) -> bool: ...
|
||||
|
||||
@@ -5,4 +5,5 @@ if sys.platform != "win32":
|
||||
def get_default_domain() -> str: ...
|
||||
def maps(domain: str = ...) -> list[str]: ...
|
||||
def match(key: str, map: str, domain: str = ...) -> str: ...
|
||||
|
||||
class error(Exception): ...
|
||||
|
||||
@@ -77,6 +77,7 @@ class _NNTPBase:
|
||||
if sys.version_info < (3, 9):
|
||||
def xgtitle(self, group: str, *, file: _File = ...) -> tuple[str, _list[tuple[str, str]]]: ...
|
||||
def xpath(self, id: Any) -> tuple[str, str]: ...
|
||||
|
||||
def date(self) -> tuple[str, datetime.datetime]: ...
|
||||
def post(self, data: bytes | Iterable[bytes]) -> str: ...
|
||||
def ihave(self, message_id: Any, data: bytes | Iterable[bytes]) -> str: ...
|
||||
|
||||
@@ -240,6 +240,7 @@ class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]):
|
||||
putenv: Callable[[AnyStr, AnyStr], None],
|
||||
unsetenv: Callable[[AnyStr, AnyStr], None],
|
||||
) -> None: ...
|
||||
|
||||
def setdefault(self, key: AnyStr, value: AnyStr) -> AnyStr: ... # type: ignore[override]
|
||||
def copy(self) -> dict[AnyStr, AnyStr]: ...
|
||||
def __delitem__(self, key: AnyStr) -> None: ...
|
||||
@@ -471,6 +472,7 @@ if sys.platform != "win32":
|
||||
if sys.platform != "darwin":
|
||||
def getresuid() -> tuple[int, int, int]: ...
|
||||
def getresgid() -> tuple[int, int, int]: ...
|
||||
|
||||
def getuid() -> int: ...
|
||||
def setegid(__egid: int) -> None: ...
|
||||
def seteuid(__euid: int) -> None: ...
|
||||
@@ -482,6 +484,7 @@ if sys.platform != "win32":
|
||||
if sys.platform != "darwin":
|
||||
def setresgid(rgid: int, egid: int, sgid: int) -> None: ...
|
||||
def setresuid(ruid: int, euid: int, suid: int) -> None: ...
|
||||
|
||||
def setreuid(__ruid: int, __euid: int) -> None: ...
|
||||
def getsid(__pid: int) -> int: ...
|
||||
def setsid() -> None: ...
|
||||
@@ -618,6 +621,7 @@ if sys.platform != "win32":
|
||||
def pipe2(__flags: int) -> tuple[int, int]: ... # some flavors of Unix
|
||||
def posix_fallocate(fd: int, offset: int, length: int) -> None: ...
|
||||
def posix_fadvise(fd: int, offset: int, length: int, advice: int) -> None: ...
|
||||
|
||||
def pread(__fd: int, __length: int, __offset: int) -> bytes: ...
|
||||
def pwrite(__fd: int, __buffer: bytes, __offset: int) -> int: ...
|
||||
if sys.platform != "darwin":
|
||||
@@ -902,7 +906,9 @@ else:
|
||||
def si_status(self) -> int: ...
|
||||
@property
|
||||
def si_code(self) -> int: ...
|
||||
|
||||
def waitid(idtype: int, ident: int, options: int) -> waitid_result: ...
|
||||
|
||||
def wait3(options: int) -> tuple[int, int, Any]: ...
|
||||
def wait4(pid: int, options: int) -> tuple[int, int, Any]: ...
|
||||
def WCOREDUMP(__status: int) -> bool: ...
|
||||
@@ -950,6 +956,7 @@ if sys.platform != "win32":
|
||||
def __new__(cls, sched_priority: int) -> sched_param: ...
|
||||
@property
|
||||
def sched_priority(self) -> int: ...
|
||||
|
||||
def sched_get_priority_min(policy: int) -> int: ... # some flavors of Unix
|
||||
def sched_get_priority_max(policy: int) -> int: ... # some flavors of Unix
|
||||
def sched_yield() -> None: ... # some flavors of Unix
|
||||
@@ -991,6 +998,7 @@ if sys.version_info >= (3, 8):
|
||||
def close(self) -> None: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(self, *args: Any) -> None: ...
|
||||
|
||||
def add_dll_directory(path: str) -> _AddedDllDirectory: ...
|
||||
if sys.platform == "linux":
|
||||
MFD_CLOEXEC: int
|
||||
|
||||
@@ -41,11 +41,13 @@ class PurePath(PathLike[str]):
|
||||
def is_reserved(self) -> bool: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def is_relative_to(self, *other: StrPath) -> bool: ...
|
||||
|
||||
def match(self, path_pattern: str) -> bool: ...
|
||||
def relative_to(self: Self, *other: StrPath) -> Self: ...
|
||||
def with_name(self: Self, name: str) -> Self: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def with_stem(self: Self, stem: str) -> Self: ...
|
||||
|
||||
def with_suffix(self: Self, suffix: str) -> Self: ...
|
||||
def joinpath(self: Self, *other: StrPath) -> Self: ...
|
||||
@property
|
||||
@@ -72,6 +74,7 @@ class Path(PurePath):
|
||||
else:
|
||||
def stat(self) -> stat_result: ...
|
||||
def chmod(self, mode: int) -> None: ...
|
||||
|
||||
def exists(self) -> bool: ...
|
||||
def glob(self: Self, pattern: str) -> Generator[Self, None, None]: ...
|
||||
def group(self) -> str: ...
|
||||
@@ -79,6 +82,7 @@ class Path(PurePath):
|
||||
def is_file(self) -> bool: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def is_mount(self) -> bool: ...
|
||||
|
||||
def is_symlink(self) -> bool: ...
|
||||
def is_socket(self) -> bool: ...
|
||||
def is_fifo(self) -> bool: ...
|
||||
@@ -152,17 +156,20 @@ class Path(PurePath):
|
||||
else:
|
||||
def rename(self, target: str | PurePath) -> None: ...
|
||||
def replace(self, target: str | PurePath) -> None: ...
|
||||
|
||||
def resolve(self: Self, strict: bool = ...) -> Self: ...
|
||||
def rglob(self: Self, pattern: str) -> Generator[Self, None, None]: ...
|
||||
def rmdir(self) -> None: ...
|
||||
def symlink_to(self, target: str | Path, target_is_directory: bool = ...) -> None: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
def hardlink_to(self, target: str | Path) -> None: ...
|
||||
|
||||
def touch(self, mode: int = ..., exist_ok: bool = ...) -> None: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def unlink(self, missing_ok: bool = ...) -> None: ...
|
||||
else:
|
||||
def unlink(self) -> None: ...
|
||||
|
||||
@classmethod
|
||||
def home(cls: type[Self]) -> Self: ...
|
||||
def absolute(self: Self) -> Self: ...
|
||||
|
||||
@@ -82,6 +82,7 @@ class Pickler:
|
||||
def reducer_override(self, obj: Any) -> Any: ...
|
||||
else:
|
||||
def __init__(self, file: _WritableFileobj, protocol: int | None = ..., *, fix_imports: bool = ...) -> None: ...
|
||||
|
||||
def dump(self, __obj: Any) -> None: ...
|
||||
def clear_memo(self) -> None: ...
|
||||
def persistent_id(self, obj: Any) -> Any: ...
|
||||
@@ -103,6 +104,7 @@ class Unpickler:
|
||||
def __init__(
|
||||
self, file: _ReadableFileobj, *, fix_imports: bool = ..., encoding: str = ..., errors: str = ...
|
||||
) -> None: ...
|
||||
|
||||
def load(self) -> Any: ...
|
||||
def find_class(self, __module_name: str, __global_name: str) -> Any: ...
|
||||
def persistent_load(self, pid: Any) -> Any: ...
|
||||
|
||||
@@ -126,6 +126,7 @@ class PrettyPrinter:
|
||||
*,
|
||||
compact: bool = ...,
|
||||
) -> None: ...
|
||||
|
||||
def pformat(self, object: object) -> str: ...
|
||||
def pprint(self, object: object) -> None: ...
|
||||
def isreadable(self, object: object) -> bool: ...
|
||||
|
||||
@@ -8,6 +8,7 @@ _Selector = Union[str, float, int]
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from enum import Enum
|
||||
|
||||
class SortKey(str, Enum):
|
||||
CALLS: str
|
||||
CUMULATIVE: str
|
||||
|
||||
@@ -20,6 +20,7 @@ if sys.platform != "win32":
|
||||
def pw_dir(self) -> str: ...
|
||||
@property
|
||||
def pw_shell(self) -> str: ...
|
||||
|
||||
def getpwall() -> list[struct_passwd]: ...
|
||||
def getpwuid(__uid: int) -> struct_passwd: ...
|
||||
def getpwnam(__name: str) -> struct_passwd: ...
|
||||
|
||||
@@ -10,6 +10,7 @@ class PyCompileError(Exception):
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
import enum
|
||||
|
||||
class PycInvalidationMode(enum.Enum):
|
||||
TIMESTAMP: int
|
||||
CHECKED_HASH: int
|
||||
|
||||
@@ -15,6 +15,7 @@ class Random(_random.Random):
|
||||
def seed(self, a: int | float | str | bytes | bytearray | None = ..., version: int = ...) -> None: ... # type: ignore[override]
|
||||
else:
|
||||
def seed(self, a: Any = ..., version: int = ...) -> None: ...
|
||||
|
||||
def getstate(self) -> tuple[Any, ...]: ...
|
||||
def setstate(self, state: tuple[Any, ...]) -> None: ...
|
||||
def getrandbits(self, __k: int) -> int: ...
|
||||
@@ -22,6 +23,7 @@ class Random(_random.Random):
|
||||
def randint(self, a: int, b: int) -> int: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def randbytes(self, n: int) -> bytes: ...
|
||||
|
||||
def choice(self, seq: SupportsLenAndGetItem[_T]) -> _T: ...
|
||||
def choices(
|
||||
self,
|
||||
@@ -38,6 +40,7 @@ class Random(_random.Random):
|
||||
) -> list[_T]: ...
|
||||
else:
|
||||
def sample(self, population: Sequence[_T] | AbstractSet[_T], k: int) -> list[_T]: ...
|
||||
|
||||
def random(self) -> float: ...
|
||||
def uniform(self, a: float, b: float) -> float: ...
|
||||
def triangular(self, low: float = ..., high: float = ..., mode: float | None = ...) -> float: ...
|
||||
|
||||
@@ -61,6 +61,7 @@ if sys.platform != "win32":
|
||||
def ru_nvcsw(self) -> int: ...
|
||||
@property
|
||||
def ru_nivcsw(self) -> int: ...
|
||||
|
||||
def getpagesize() -> int: ...
|
||||
def getrlimit(__resource: int) -> tuple[int, int]: ...
|
||||
def getrusage(__who: int) -> struct_rusage: ...
|
||||
|
||||
@@ -105,10 +105,12 @@ else:
|
||||
SIGWINCH: Signals
|
||||
SIGXCPU: Signals
|
||||
SIGXFSZ: Signals
|
||||
|
||||
class ItimerError(IOError): ...
|
||||
ITIMER_PROF: int
|
||||
ITIMER_REAL: int
|
||||
ITIMER_VIRTUAL: int
|
||||
|
||||
class Sigmasks(IntEnum):
|
||||
SIG_BLOCK: int
|
||||
SIG_UNBLOCK: int
|
||||
@@ -147,6 +149,7 @@ else:
|
||||
def si_status(self) -> int: ...
|
||||
@property
|
||||
def si_band(self) -> int: ...
|
||||
|
||||
def sigtimedwait(sigset: Iterable[int], timeout: float) -> struct_siginfo | None: ...
|
||||
def sigwaitinfo(sigset: Iterable[int]) -> struct_siginfo: ...
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ if sys.platform != "win32":
|
||||
RequestHandlerClass: Callable[..., BaseRequestHandler],
|
||||
bind_and_activate: bool = ...,
|
||||
) -> None: ...
|
||||
|
||||
class UnixDatagramServer(BaseServer):
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
@@ -24,5 +24,6 @@ if sys.platform != "win32":
|
||||
def sp_expire(self) -> int: ...
|
||||
@property
|
||||
def sp_flag(self) -> int: ...
|
||||
|
||||
def getspall() -> list[struct_spwd]: ...
|
||||
def getspnam(__arg: str) -> struct_spwd: ...
|
||||
|
||||
@@ -151,6 +151,7 @@ class Connection:
|
||||
def create_function(self, name: str, narg: int, func: Any, *, deterministic: bool = ...) -> None: ...
|
||||
else:
|
||||
def create_function(self, name: str, num_params: int, func: Any) -> None: ...
|
||||
|
||||
def cursor(self, cursorClass: type | None = ...) -> Cursor: ...
|
||||
def execute(self, sql: str, parameters: Iterable[Any] = ...) -> Cursor: ...
|
||||
# TODO: please check in executemany() if seq_of_parameters type is possible like this
|
||||
@@ -178,6 +179,7 @@ class Connection:
|
||||
name: str = ...,
|
||||
sleep: float = ...,
|
||||
) -> None: ...
|
||||
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(self, t: type | None, exc: BaseException | None, tb: Any | None) -> None: ...
|
||||
|
||||
@@ -54,6 +54,7 @@ class SubPattern:
|
||||
else:
|
||||
pattern: Pattern
|
||||
def __init__(self, pattern: Pattern, data: list[_CodeType] | None = ...) -> None: ...
|
||||
|
||||
def dump(self, level: int = ...) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __delitem__(self, index: int | slice) -> None: ...
|
||||
@@ -77,6 +78,7 @@ class Tokenizer:
|
||||
def getuntil(self, terminator: str, name: str) -> str: ...
|
||||
else:
|
||||
def getuntil(self, terminator: str) -> str: ...
|
||||
|
||||
@property
|
||||
def pos(self) -> int: ...
|
||||
def tell(self) -> int: ...
|
||||
|
||||
@@ -332,6 +332,7 @@ class SSLSocket(socket.socket):
|
||||
_context: SSLContext | None = ...,
|
||||
_session: Any | None = ...,
|
||||
) -> None: ...
|
||||
|
||||
def connect(self, addr: socket._Address | bytes) -> None: ...
|
||||
def connect_ex(self, addr: socket._Address | bytes) -> int: ...
|
||||
def recv(self, buflen: int = ..., flags: int = ...) -> bytes: ...
|
||||
@@ -416,6 +417,7 @@ class SSLContext:
|
||||
def set_servername_callback(self, server_name_callback: _SrvnmeCbType | None) -> None: ...
|
||||
else:
|
||||
def set_servername_callback(self, __method: _SrvnmeCbType | None) -> None: ...
|
||||
|
||||
def load_dh_params(self, __path: str) -> None: ...
|
||||
def set_ecdh_curve(self, __name: str) -> None: ...
|
||||
def wrap_socket(
|
||||
@@ -447,6 +449,7 @@ class SSLObject:
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
else:
|
||||
def __init__(self, sslobj: Any, owner: SSLSocket | SSLObject | None = ..., session: Any | None = ...) -> None: ...
|
||||
|
||||
def read(self, len: int = ..., buffer: bytearray | None = ...) -> bytes: ...
|
||||
def write(self, data: bytes) -> int: ...
|
||||
@overload
|
||||
|
||||
@@ -66,6 +66,7 @@ if sys.version_info >= (3, 8):
|
||||
def quantiles(self, n: int = ...) -> list[float]: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def zscore(self, x: float) -> float: ...
|
||||
|
||||
def __add__(self, x2: float | NormalDist) -> NormalDist: ...
|
||||
def __sub__(self, x2: float | NormalDist) -> NormalDist: ...
|
||||
def __mul__(self, x2: float) -> NormalDist: ...
|
||||
@@ -80,6 +81,7 @@ if sys.version_info >= (3, 8):
|
||||
if sys.version_info >= (3, 10):
|
||||
def correlation(__x: Sequence[_Number], __y: Sequence[_Number]) -> float: ...
|
||||
def covariance(__x: Sequence[_Number], __y: Sequence[_Number]) -> float: ...
|
||||
|
||||
class LinearRegression(NamedTuple):
|
||||
slope: float
|
||||
intercept: float
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user