mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-29 03:06:43 +08:00
Remove Python 3.6 branches from typeshed (#8269)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import sys
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
_VersionInfo: TypeAlias = tuple[int, int, int, str, int]
|
||||
@@ -18,9 +17,7 @@ unicode_literals: _Feature
|
||||
with_statement: _Feature
|
||||
barry_as_FLUFL: _Feature
|
||||
generator_stop: _Feature
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
annotations: _Feature
|
||||
annotations: _Feature
|
||||
|
||||
all_feature_names: list[str] # undocumented
|
||||
|
||||
@@ -35,7 +32,5 @@ __all__ = [
|
||||
"with_statement",
|
||||
"barry_as_FLUFL",
|
||||
"generator_stop",
|
||||
"annotations",
|
||||
]
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ += ["annotations"]
|
||||
|
||||
+1
-2
@@ -60,8 +60,7 @@ if sys.platform != "win32":
|
||||
A_DIM: int
|
||||
A_HORIZONTAL: int
|
||||
A_INVIS: int
|
||||
if sys.version_info >= (3, 7):
|
||||
A_ITALIC: int
|
||||
A_ITALIC: int
|
||||
A_LEFT: int
|
||||
A_LOW: int
|
||||
A_NORMAL: int
|
||||
|
||||
+1
-3
@@ -26,9 +26,7 @@ ROUND_FLOOR: str
|
||||
ROUND_UP: str
|
||||
ROUND_HALF_DOWN: str
|
||||
ROUND_05UP: str
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
HAVE_CONTEXTVAR: bool
|
||||
HAVE_CONTEXTVAR: bool
|
||||
HAVE_THREADS: bool
|
||||
MAX_EMAX: int
|
||||
MAX_PREC: int
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import sys
|
||||
from collections.abc import Callable
|
||||
from types import TracebackType
|
||||
from typing import Any, NoReturn
|
||||
|
||||
__all__ = ["error", "start_new_thread", "exit", "get_ident", "allocate_lock", "interrupt_main", "LockType"]
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ += ["RLock"]
|
||||
__all__ = ["error", "start_new_thread", "exit", "get_ident", "allocate_lock", "interrupt_main", "LockType", "RLock"]
|
||||
|
||||
TIMEOUT_MAX: int
|
||||
error = RuntimeError
|
||||
@@ -26,8 +22,7 @@ class LockType:
|
||||
def release(self) -> bool: ...
|
||||
def locked(self) -> bool: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
class RLock(LockType):
|
||||
def release(self) -> None: ... # type: ignore[override]
|
||||
class RLock(LockType):
|
||||
def release(self) -> None: ... # type: ignore[override]
|
||||
|
||||
def interrupt_main() -> None: ...
|
||||
|
||||
+2
-3
@@ -4,10 +4,9 @@ from _typeshed import ReadableBuffer
|
||||
from importlib.machinery import ModuleSpec
|
||||
from typing import Any
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
check_hash_based_pycs: str
|
||||
def source_hash(key: int, source: ReadableBuffer) -> bytes: ...
|
||||
check_hash_based_pycs: str
|
||||
|
||||
def source_hash(key: int, source: ReadableBuffer) -> bytes: ...
|
||||
def create_builtin(__spec: ModuleSpec) -> types.ModuleType: ...
|
||||
def create_dynamic(__spec: ModuleSpec, __file: Any = ...) -> types.ModuleType: ...
|
||||
def acquire_lock() -> None: ...
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import sys
|
||||
|
||||
# This is a slight lie, the implementations aren't exactly identical
|
||||
# However, in all likelihood, the differences are inconsequential
|
||||
from _decimal import *
|
||||
@@ -41,7 +39,5 @@ __all__ = [
|
||||
"MIN_EMIN",
|
||||
"MIN_ETINY",
|
||||
"HAVE_THREADS",
|
||||
"HAVE_CONTEXTVAR",
|
||||
]
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ += ["HAVE_CONTEXTVAR"]
|
||||
|
||||
+9
-15
@@ -176,8 +176,7 @@ MSG_CTRUNC: int
|
||||
MSG_DONTROUTE: int
|
||||
|
||||
if sys.platform != "darwin":
|
||||
if sys.platform != "win32" or sys.version_info >= (3, 7):
|
||||
MSG_ERRQUEUE: int
|
||||
MSG_ERRQUEUE: int
|
||||
|
||||
MSG_OOB: int
|
||||
MSG_PEEK: int
|
||||
@@ -218,15 +217,14 @@ if sys.platform == "linux" and sys.version_info >= (3, 11):
|
||||
SO_INCOMING_CPU: int
|
||||
TCP_FASTOPEN: int
|
||||
TCP_KEEPCNT: int
|
||||
TCP_KEEPINTVL: int
|
||||
|
||||
if sys.platform != "win32" or sys.version_info >= (3, 7):
|
||||
TCP_KEEPINTVL: int
|
||||
if sys.platform != "darwin":
|
||||
TCP_KEEPIDLE: int
|
||||
if sys.platform != "darwin":
|
||||
TCP_KEEPIDLE: int
|
||||
|
||||
TCP_MAXSEG: int
|
||||
TCP_NODELAY: int
|
||||
if sys.version_info >= (3, 7) and sys.platform != "win32":
|
||||
if sys.platform != "win32":
|
||||
TCP_NOTSENT_LOWAT: int
|
||||
if sys.version_info >= (3, 10) and sys.platform == "darwin":
|
||||
TCP_KEEPALIVE: int
|
||||
@@ -368,7 +366,7 @@ if sys.platform == "linux" and sys.version_info >= (3, 8):
|
||||
CAN_BCM_RX_RTR_FRAME: int
|
||||
CAN_BCM_CAN_FD_FRAME: int
|
||||
|
||||
if sys.platform == "linux" and sys.version_info >= (3, 7):
|
||||
if sys.platform == "linux":
|
||||
CAN_ISOTP: int
|
||||
|
||||
if sys.platform == "linux" and sys.version_info >= (3, 9):
|
||||
@@ -491,7 +489,7 @@ if sys.platform == "linux":
|
||||
ALG_SET_OP: int
|
||||
ALG_SET_PUBKEY: int
|
||||
|
||||
if sys.platform == "linux" and sys.version_info >= (3, 7):
|
||||
if sys.platform == "linux":
|
||||
AF_VSOCK: int
|
||||
IOCTL_VM_SOCKETS_GET_LOCAL_CID: int
|
||||
VMADDR_CID_ANY: int
|
||||
@@ -598,9 +596,7 @@ class socket:
|
||||
def getsockopt(self, __level: int, __optname: int) -> int: ...
|
||||
@overload
|
||||
def getsockopt(self, __level: int, __optname: int, __buflen: int) -> bytes: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def getblocking(self) -> bool: ...
|
||||
|
||||
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: ...
|
||||
@@ -650,9 +646,7 @@ SocketType = socket
|
||||
|
||||
# ----- Functions -----
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def close(__fd: _FD) -> None: ...
|
||||
|
||||
def close(__fd: _FD) -> None: ...
|
||||
def dup(__fd: _FD) -> int: ...
|
||||
|
||||
# the 5th tuple item is an address
|
||||
|
||||
+17
-24
@@ -4,16 +4,14 @@ from typing import Any, NoReturn, overload
|
||||
from typing_extensions import Literal, final
|
||||
|
||||
if sys.platform == "win32":
|
||||
if sys.version_info >= (3, 7):
|
||||
ABOVE_NORMAL_PRIORITY_CLASS: Literal[32768]
|
||||
BELOW_NORMAL_PRIORITY_CLASS: Literal[16384]
|
||||
CREATE_BREAKAWAY_FROM_JOB: Literal[16777216]
|
||||
CREATE_DEFAULT_ERROR_MODE: Literal[67108864]
|
||||
CREATE_NO_WINDOW: Literal[134217728]
|
||||
ABOVE_NORMAL_PRIORITY_CLASS: Literal[32768]
|
||||
BELOW_NORMAL_PRIORITY_CLASS: Literal[16384]
|
||||
CREATE_BREAKAWAY_FROM_JOB: Literal[16777216]
|
||||
CREATE_DEFAULT_ERROR_MODE: Literal[67108864]
|
||||
CREATE_NO_WINDOW: Literal[134217728]
|
||||
CREATE_NEW_CONSOLE: Literal[16]
|
||||
CREATE_NEW_PROCESS_GROUP: Literal[512]
|
||||
if sys.version_info >= (3, 7):
|
||||
DETACHED_PROCESS: Literal[8]
|
||||
DETACHED_PROCESS: Literal[8]
|
||||
DUPLICATE_CLOSE_SOURCE: Literal[1]
|
||||
DUPLICATE_SAME_ACCESS: Literal[2]
|
||||
|
||||
@@ -39,24 +37,21 @@ if sys.platform == "win32":
|
||||
FILE_MAP_EXECUTE: Literal[32]
|
||||
FILE_MAP_READ: Literal[4]
|
||||
FILE_MAP_WRITE: Literal[2]
|
||||
if sys.version_info >= (3, 7):
|
||||
FILE_TYPE_CHAR: Literal[2]
|
||||
FILE_TYPE_DISK: Literal[1]
|
||||
FILE_TYPE_PIPE: Literal[3]
|
||||
FILE_TYPE_REMOTE: Literal[32768]
|
||||
FILE_TYPE_UNKNOWN: Literal[0]
|
||||
FILE_TYPE_CHAR: Literal[2]
|
||||
FILE_TYPE_DISK: Literal[1]
|
||||
FILE_TYPE_PIPE: Literal[3]
|
||||
FILE_TYPE_REMOTE: Literal[32768]
|
||||
FILE_TYPE_UNKNOWN: Literal[0]
|
||||
|
||||
GENERIC_READ: Literal[2147483648]
|
||||
GENERIC_WRITE: Literal[1073741824]
|
||||
if sys.version_info >= (3, 7):
|
||||
HIGH_PRIORITY_CLASS: Literal[128]
|
||||
HIGH_PRIORITY_CLASS: Literal[128]
|
||||
INFINITE: Literal[4294967295]
|
||||
if sys.version_info >= (3, 8):
|
||||
INVALID_HANDLE_VALUE: int # very large number
|
||||
if sys.version_info >= (3, 7):
|
||||
IDLE_PRIORITY_CLASS: Literal[64]
|
||||
NORMAL_PRIORITY_CLASS: Literal[32]
|
||||
REALTIME_PRIORITY_CLASS: Literal[256]
|
||||
IDLE_PRIORITY_CLASS: Literal[64]
|
||||
NORMAL_PRIORITY_CLASS: Literal[32]
|
||||
REALTIME_PRIORITY_CLASS: Literal[256]
|
||||
NMPWAIT_WAIT_FOREVER: Literal[4294967295]
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
@@ -158,10 +153,8 @@ if sys.platform == "win32":
|
||||
__options: int = ...,
|
||||
) -> int: ...
|
||||
def ExitProcess(__ExitCode: int) -> NoReturn: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def GetACP() -> int: ...
|
||||
def GetFileType(handle: int) -> int: ...
|
||||
|
||||
def GetACP() -> int: ...
|
||||
def GetFileType(handle: int) -> int: ...
|
||||
def GetCurrentProcess() -> int: ...
|
||||
def GetExitCodeProcess(__process: int) -> int: ...
|
||||
def GetLastError() -> int: ...
|
||||
|
||||
+43
-89
@@ -171,65 +171,35 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
||||
def parse_args(self, *, namespace: None) -> Namespace: ... # type: ignore[misc]
|
||||
@overload
|
||||
def parse_args(self, *, namespace: _N) -> _N: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
@overload
|
||||
def add_subparsers(
|
||||
self: _ArgumentParserT,
|
||||
*,
|
||||
title: str = ...,
|
||||
description: str | None = ...,
|
||||
prog: str = ...,
|
||||
action: type[Action] = ...,
|
||||
option_string: str = ...,
|
||||
dest: str | None = ...,
|
||||
required: bool = ...,
|
||||
help: str | None = ...,
|
||||
metavar: str | None = ...,
|
||||
) -> _SubParsersAction[_ArgumentParserT]: ...
|
||||
@overload
|
||||
def add_subparsers(
|
||||
self,
|
||||
*,
|
||||
title: str = ...,
|
||||
description: str | None = ...,
|
||||
prog: str = ...,
|
||||
parser_class: type[_ArgumentParserT],
|
||||
action: type[Action] = ...,
|
||||
option_string: str = ...,
|
||||
dest: str | None = ...,
|
||||
required: bool = ...,
|
||||
help: str | None = ...,
|
||||
metavar: str | None = ...,
|
||||
) -> _SubParsersAction[_ArgumentParserT]: ...
|
||||
else:
|
||||
@overload
|
||||
def add_subparsers(
|
||||
self: _ArgumentParserT,
|
||||
*,
|
||||
title: str = ...,
|
||||
description: str | None = ...,
|
||||
prog: str = ...,
|
||||
action: type[Action] = ...,
|
||||
option_string: str = ...,
|
||||
dest: str | None = ...,
|
||||
help: str | None = ...,
|
||||
metavar: str | None = ...,
|
||||
) -> _SubParsersAction[_ArgumentParserT]: ...
|
||||
@overload
|
||||
def add_subparsers(
|
||||
self,
|
||||
*,
|
||||
title: str = ...,
|
||||
description: str | None = ...,
|
||||
prog: str = ...,
|
||||
parser_class: type[_ArgumentParserT],
|
||||
action: type[Action] = ...,
|
||||
option_string: str = ...,
|
||||
dest: str | None = ...,
|
||||
help: str | None = ...,
|
||||
metavar: str | None = ...,
|
||||
) -> _SubParsersAction[_ArgumentParserT]: ...
|
||||
|
||||
@overload
|
||||
def add_subparsers(
|
||||
self: _ArgumentParserT,
|
||||
*,
|
||||
title: str = ...,
|
||||
description: str | None = ...,
|
||||
prog: str = ...,
|
||||
action: type[Action] = ...,
|
||||
option_string: str = ...,
|
||||
dest: str | None = ...,
|
||||
required: bool = ...,
|
||||
help: str | None = ...,
|
||||
metavar: str | None = ...,
|
||||
) -> _SubParsersAction[_ArgumentParserT]: ...
|
||||
@overload
|
||||
def add_subparsers(
|
||||
self,
|
||||
*,
|
||||
title: str = ...,
|
||||
description: str | None = ...,
|
||||
prog: str = ...,
|
||||
parser_class: type[_ArgumentParserT],
|
||||
action: type[Action] = ...,
|
||||
option_string: str = ...,
|
||||
dest: str | None = ...,
|
||||
required: bool = ...,
|
||||
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: ...
|
||||
@@ -240,11 +210,10 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
||||
def convert_arg_line_to_args(self, arg_line: str) -> list[str]: ...
|
||||
def exit(self, status: int = ..., message: str | None = ...) -> NoReturn: ...
|
||||
def error(self, message: str) -> NoReturn: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def parse_intermixed_args(self, args: Sequence[str] | None = ..., namespace: Namespace | None = ...) -> Namespace: ...
|
||||
def parse_known_intermixed_args(
|
||||
self, args: Sequence[str] | None = ..., namespace: Namespace | None = ...
|
||||
) -> tuple[Namespace, list[str]]: ...
|
||||
def parse_intermixed_args(self, args: Sequence[str] | None = ..., namespace: Namespace | None = ...) -> Namespace: ...
|
||||
def parse_known_intermixed_args(
|
||||
self, args: Sequence[str] | None = ..., namespace: Namespace | None = ...
|
||||
) -> tuple[Namespace, list[str]]: ...
|
||||
# undocumented
|
||||
def _get_optional_actions(self) -> list[Action]: ...
|
||||
def _get_positional_actions(self) -> list[Action]: ...
|
||||
@@ -478,27 +447,16 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]):
|
||||
_name_parser_map: dict[str, _ArgumentParserT]
|
||||
choices: dict[str, _ArgumentParserT]
|
||||
_choices_actions: list[Action]
|
||||
if sys.version_info >= (3, 7):
|
||||
def __init__(
|
||||
self,
|
||||
option_strings: Sequence[str],
|
||||
prog: str,
|
||||
parser_class: type[_ArgumentParserT],
|
||||
dest: str = ...,
|
||||
required: bool = ...,
|
||||
help: str | None = ...,
|
||||
metavar: str | tuple[str, ...] | None = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
option_strings: Sequence[str],
|
||||
prog: str,
|
||||
parser_class: type[_ArgumentParserT],
|
||||
dest: str = ...,
|
||||
help: str | None = ...,
|
||||
metavar: str | tuple[str, ...] | None = ...,
|
||||
) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
option_strings: Sequence[str],
|
||||
prog: str,
|
||||
parser_class: type[_ArgumentParserT],
|
||||
dest: str = ...,
|
||||
required: bool = ...,
|
||||
help: str | None = ...,
|
||||
metavar: str | tuple[str, ...] | None = ...,
|
||||
) -> None: ...
|
||||
# TODO: Type keyword args properly.
|
||||
def add_parser(self, name: str, **kwargs: Any) -> _ArgumentParserT: ...
|
||||
def _get_subactions(self) -> list[Action]: ...
|
||||
@@ -506,9 +464,5 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]):
|
||||
# undocumented
|
||||
class ArgumentTypeError(Exception): ...
|
||||
|
||||
if sys.version_info < (3, 7):
|
||||
# undocumented
|
||||
def _ensure_value(namespace: Namespace, name: str, value: Any) -> Any: ...
|
||||
|
||||
# undocumented
|
||||
def _get_action_name(argument: Action | None) -> str | None: ...
|
||||
|
||||
@@ -8,14 +8,12 @@ from .futures import *
|
||||
from .locks import *
|
||||
from .protocols import *
|
||||
from .queues import *
|
||||
from .runners import *
|
||||
from .streams import *
|
||||
from .subprocess import *
|
||||
from .tasks import *
|
||||
from .transports import *
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from .runners import *
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from .exceptions import *
|
||||
|
||||
|
||||
+31
-122
@@ -7,19 +7,15 @@ from asyncio.protocols import BaseProtocol
|
||||
from asyncio.tasks import Task
|
||||
from asyncio.transports import BaseTransport, ReadTransport, SubprocessTransport, WriteTransport
|
||||
from collections.abc import Awaitable, Callable, Coroutine, Generator, Iterable, Sequence
|
||||
from contextvars import Context
|
||||
from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket
|
||||
from typing import IO, Any, TypeVar, overload
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from contextvars import Context
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
__all__ = ("BaseEventLoop", "Server")
|
||||
elif sys.version_info >= (3, 7):
|
||||
__all__ = ("BaseEventLoop",)
|
||||
else:
|
||||
__all__ = ["BaseEventLoop"]
|
||||
__all__ = ("BaseEventLoop",)
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_ProtocolT = TypeVar("_ProtocolT", bound=BaseProtocol)
|
||||
@@ -40,7 +36,7 @@ class Server(AbstractServer):
|
||||
ssl_handshake_timeout: float | None,
|
||||
ssl_shutdown_timeout: float | None = ...,
|
||||
) -> None: ...
|
||||
elif sys.version_info >= (3, 7):
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
loop: AbstractEventLoop,
|
||||
@@ -50,21 +46,18 @@ class Server(AbstractServer):
|
||||
backlog: int,
|
||||
ssl_handshake_timeout: float | None,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, loop: AbstractEventLoop, sockets: list[socket]) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def get_loop(self) -> AbstractEventLoop: ...
|
||||
def is_serving(self) -> bool: ...
|
||||
async def start_serving(self) -> None: ...
|
||||
async def serve_forever(self) -> None: ...
|
||||
|
||||
def get_loop(self) -> AbstractEventLoop: ...
|
||||
def is_serving(self) -> bool: ...
|
||||
async def start_serving(self) -> None: ...
|
||||
async def serve_forever(self) -> None: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
@property
|
||||
def sockets(self) -> tuple[socket, ...]: ...
|
||||
elif sys.version_info >= (3, 7):
|
||||
else:
|
||||
@property
|
||||
def sockets(self) -> list[socket]: ...
|
||||
else:
|
||||
sockets: list[socket] | None
|
||||
|
||||
def close(self) -> None: ...
|
||||
async def wait_closed(self) -> None: ...
|
||||
|
||||
@@ -81,19 +74,11 @@ class BaseEventLoop(AbstractEventLoop):
|
||||
def close(self) -> None: ...
|
||||
async def shutdown_asyncgens(self) -> None: ...
|
||||
# Methods scheduling callbacks. All these return Handles.
|
||||
if sys.version_info >= (3, 7):
|
||||
def call_soon(self, callback: Callable[..., Any], *args: Any, context: Context | None = ...) -> Handle: ...
|
||||
def call_later(
|
||||
self, delay: float, callback: Callable[..., Any], *args: Any, context: Context | None = ...
|
||||
) -> TimerHandle: ...
|
||||
def call_at(
|
||||
self, when: float, callback: Callable[..., Any], *args: Any, context: Context | None = ...
|
||||
) -> TimerHandle: ...
|
||||
else:
|
||||
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 call_soon(self, callback: Callable[..., Any], *args: Any, context: Context | None = ...) -> Handle: ...
|
||||
def call_later(
|
||||
self, delay: float, callback: Callable[..., Any], *args: Any, context: Context | None = ...
|
||||
) -> TimerHandle: ...
|
||||
def call_at(self, when: float, callback: Callable[..., Any], *args: Any, context: Context | None = ...) -> TimerHandle: ...
|
||||
def time(self) -> float: ...
|
||||
# Future methods
|
||||
def create_future(self) -> Future[Any]: ...
|
||||
@@ -110,11 +95,7 @@ class BaseEventLoop(AbstractEventLoop):
|
||||
def set_task_factory(self, factory: _TaskFactory | None) -> None: ...
|
||||
def get_task_factory(self) -> _TaskFactory | None: ...
|
||||
# Methods for interacting with threads
|
||||
if sys.version_info >= (3, 7):
|
||||
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 call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any, context: Context | None = ...) -> 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.
|
||||
@@ -205,39 +186,6 @@ class BaseEventLoop(AbstractEventLoop):
|
||||
happy_eyeballs_delay: float | None = ...,
|
||||
interleave: int | None = ...,
|
||||
) -> tuple[BaseTransport, _ProtocolT]: ...
|
||||
elif sys.version_info >= (3, 7):
|
||||
@overload
|
||||
async def create_connection(
|
||||
self,
|
||||
protocol_factory: Callable[[], _ProtocolT],
|
||||
host: str = ...,
|
||||
port: int = ...,
|
||||
*,
|
||||
ssl: _SSLContext = ...,
|
||||
family: int = ...,
|
||||
proto: int = ...,
|
||||
flags: int = ...,
|
||||
sock: None = ...,
|
||||
local_addr: tuple[str, int] | None = ...,
|
||||
server_hostname: str | None = ...,
|
||||
ssl_handshake_timeout: float | None = ...,
|
||||
) -> tuple[BaseTransport, _ProtocolT]: ...
|
||||
@overload
|
||||
async def create_connection(
|
||||
self,
|
||||
protocol_factory: Callable[[], _ProtocolT],
|
||||
host: None = ...,
|
||||
port: None = ...,
|
||||
*,
|
||||
ssl: _SSLContext = ...,
|
||||
family: int = ...,
|
||||
proto: int = ...,
|
||||
flags: int = ...,
|
||||
sock: socket,
|
||||
local_addr: None = ...,
|
||||
server_hostname: str | None = ...,
|
||||
ssl_handshake_timeout: float | None = ...,
|
||||
) -> tuple[BaseTransport, _ProtocolT]: ...
|
||||
else:
|
||||
@overload
|
||||
async def create_connection(
|
||||
@@ -253,6 +201,7 @@ class BaseEventLoop(AbstractEventLoop):
|
||||
sock: None = ...,
|
||||
local_addr: tuple[str, int] | None = ...,
|
||||
server_hostname: str | None = ...,
|
||||
ssl_handshake_timeout: float | None = ...,
|
||||
) -> tuple[BaseTransport, _ProtocolT]: ...
|
||||
@overload
|
||||
async def create_connection(
|
||||
@@ -268,6 +217,7 @@ class BaseEventLoop(AbstractEventLoop):
|
||||
sock: socket,
|
||||
local_addr: None = ...,
|
||||
server_hostname: str | None = ...,
|
||||
ssl_handshake_timeout: float | None = ...,
|
||||
) -> tuple[BaseTransport, _ProtocolT]: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
@overload
|
||||
@@ -326,7 +276,7 @@ class BaseEventLoop(AbstractEventLoop):
|
||||
ssl_handshake_timeout: float | None = ...,
|
||||
ssl_shutdown_timeout: float | None = ...,
|
||||
) -> tuple[BaseTransport, _ProtocolT]: ...
|
||||
elif sys.version_info >= (3, 7):
|
||||
else:
|
||||
@overload
|
||||
async def create_server(
|
||||
self,
|
||||
@@ -379,47 +329,13 @@ class BaseEventLoop(AbstractEventLoop):
|
||||
ssl: _SSLContext = ...,
|
||||
ssl_handshake_timeout: float | None = ...,
|
||||
) -> tuple[BaseTransport, _ProtocolT]: ...
|
||||
else:
|
||||
@overload
|
||||
async def create_server(
|
||||
self,
|
||||
protocol_factory: _ProtocolFactory,
|
||||
host: str | Sequence[str] | None = ...,
|
||||
port: int = ...,
|
||||
*,
|
||||
family: int = ...,
|
||||
flags: int = ...,
|
||||
sock: None = ...,
|
||||
backlog: int = ...,
|
||||
ssl: _SSLContext = ...,
|
||||
reuse_address: bool | None = ...,
|
||||
reuse_port: bool | None = ...,
|
||||
) -> Server: ...
|
||||
@overload
|
||||
async def create_server(
|
||||
self,
|
||||
protocol_factory: _ProtocolFactory,
|
||||
host: None = ...,
|
||||
port: None = ...,
|
||||
*,
|
||||
family: int = ...,
|
||||
flags: int = ...,
|
||||
sock: socket,
|
||||
backlog: int = ...,
|
||||
ssl: _SSLContext = ...,
|
||||
reuse_address: bool | None = ...,
|
||||
reuse_port: bool | None = ...,
|
||||
) -> Server: ...
|
||||
async def connect_accepted_socket(
|
||||
self, protocol_factory: Callable[[], _ProtocolT], sock: socket, *, ssl: _SSLContext = ...
|
||||
) -> tuple[BaseTransport, _ProtocolT]: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
async def sock_sendfile(
|
||||
self, sock: socket, file: IO[bytes], offset: int = ..., count: int | None = ..., *, fallback: bool | None = ...
|
||||
) -> int: ...
|
||||
async def sendfile(
|
||||
self, transport: BaseTransport, file: IO[bytes], offset: int = ..., count: int | None = ..., *, fallback: bool = ...
|
||||
) -> int: ...
|
||||
|
||||
async def sock_sendfile(
|
||||
self, sock: socket, file: IO[bytes], offset: int = ..., count: int | None = ..., *, fallback: bool | None = ...
|
||||
) -> int: ...
|
||||
async def sendfile(
|
||||
self, transport: BaseTransport, file: IO[bytes], offset: int = ..., count: int | None = ..., *, fallback: bool = ...
|
||||
) -> int: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
async def create_datagram_endpoint( # type: ignore[override]
|
||||
self,
|
||||
@@ -493,18 +409,11 @@ class BaseEventLoop(AbstractEventLoop):
|
||||
def remove_writer(self, fd: FileDescriptorLike) -> bool: ...
|
||||
# The sock_* methods (and probably some others) are not actually implemented on
|
||||
# BaseEventLoop, only on subclasses. We list them here for now for convenience.
|
||||
# Completion based I/O methods returning Futures prior to 3.7
|
||||
if sys.version_info >= (3, 7):
|
||||
async def sock_recv(self, sock: socket, nbytes: int) -> bytes: ...
|
||||
async def sock_recv_into(self, sock: socket, buf: WriteableBuffer) -> int: ...
|
||||
async def sock_sendall(self, sock: socket, data: bytes) -> None: ...
|
||||
async def sock_connect(self, sock: socket, address: _Address) -> None: ...
|
||||
async def sock_accept(self, sock: socket) -> tuple[socket, _RetAddress]: ...
|
||||
else:
|
||||
def sock_recv(self, sock: socket, nbytes: int) -> Future[bytes]: ...
|
||||
def sock_sendall(self, sock: socket, data: bytes) -> Future[None]: ...
|
||||
def sock_connect(self, sock: socket, address: _Address) -> Future[None]: ...
|
||||
def sock_accept(self, sock: socket) -> Future[tuple[socket, _RetAddress]]: ...
|
||||
async def sock_recv(self, sock: socket, nbytes: int) -> bytes: ...
|
||||
async def sock_recv_into(self, sock: socket, buf: WriteableBuffer) -> int: ...
|
||||
async def sock_sendall(self, sock: socket, data: bytes) -> None: ...
|
||||
async def sock_connect(self, sock: socket, address: _Address) -> None: ...
|
||||
async def sock_accept(self, sock: socket) -> tuple[socket, _RetAddress]: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
async def sock_recvfrom(self, sock: socket, bufsize: int) -> bytes: ...
|
||||
async def sock_recvfrom_into(self, sock: socket, buf: WriteableBuffer, nbytes: int = ...) -> int: ...
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
import sys
|
||||
from collections.abc import Callable, Sequence
|
||||
from contextvars import Context
|
||||
from typing import Any
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from contextvars import Context
|
||||
|
||||
from . import futures
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ = ()
|
||||
else:
|
||||
__all__: list[str] = []
|
||||
__all__ = ()
|
||||
|
||||
# asyncio defines 'isfuture()' in base_futures.py and re-imports it in futures.py
|
||||
# but it leads to circular import error in pytype tool.
|
||||
@@ -22,10 +16,5 @@ _PENDING: Literal["PENDING"] # undocumented
|
||||
_CANCELLED: Literal["CANCELLED"] # undocumented
|
||||
_FINISHED: Literal["FINISHED"] # undocumented
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def _format_callbacks(cb: Sequence[tuple[Callable[[futures.Future[Any]], None], Context]]) -> str: ... # undocumented
|
||||
|
||||
else:
|
||||
def _format_callbacks(cb: Sequence[Callable[[futures.Future[Any]], None]]) -> str: ... # undocumented
|
||||
|
||||
def _format_callbacks(cb: Sequence[tuple[Callable[[futures.Future[Any]], None], Context]]) -> str: ... # undocumented
|
||||
def _future_repr_info(future: futures.Future[Any]) -> list[str]: ... # undocumented
|
||||
|
||||
@@ -5,9 +5,8 @@ from typing_extensions import Literal
|
||||
LOG_THRESHOLD_FOR_CONNLOST_WRITES: Literal[5]
|
||||
ACCEPT_RETRY_DELAY: Literal[1]
|
||||
DEBUG_STACK_DEPTH: Literal[10]
|
||||
if sys.version_info >= (3, 7):
|
||||
SSL_HANDSHAKE_TIMEOUT: float
|
||||
SENDFILE_FALLBACK_READBUFFER_SIZE: Literal[262144]
|
||||
SSL_HANDSHAKE_TIMEOUT: float
|
||||
SENDFILE_FALLBACK_READBUFFER_SIZE: Literal[262144]
|
||||
if sys.version_info >= (3, 11):
|
||||
SSL_SHUTDOWN_TIMEOUT: float
|
||||
FLOW_CONTROL_HIGH_WATER_SSL_READ: Literal[256]
|
||||
|
||||
@@ -5,10 +5,8 @@ from typing_extensions import TypeGuard
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
__all__ = ("iscoroutinefunction", "iscoroutine")
|
||||
elif sys.version_info >= (3, 7):
|
||||
__all__ = ("coroutine", "iscoroutinefunction", "iscoroutine")
|
||||
else:
|
||||
__all__ = ["coroutine", "iscoroutinefunction", "iscoroutine"]
|
||||
__all__ = ("coroutine", "iscoroutinefunction", "iscoroutine")
|
||||
|
||||
if sys.version_info < (3, 11):
|
||||
from collections.abc import Callable
|
||||
|
||||
+50
-180
@@ -3,6 +3,7 @@ import sys
|
||||
from _typeshed import FileDescriptorLike, Self, WriteableBuffer
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from collections.abc import Awaitable, Callable, Coroutine, Generator, Sequence
|
||||
from contextvars import Context
|
||||
from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket
|
||||
from typing import IO, Any, Protocol, TypeVar, overload
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
@@ -14,9 +15,6 @@ from .tasks import Task
|
||||
from .transports import BaseTransport, ReadTransport, SubprocessTransport, WriteTransport
|
||||
from .unix_events import AbstractChildWatcher
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from contextvars import Context
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
__all__ = (
|
||||
"AbstractEventLoopPolicy",
|
||||
@@ -36,7 +34,7 @@ if sys.version_info >= (3, 8):
|
||||
"_get_running_loop",
|
||||
)
|
||||
|
||||
elif sys.version_info >= (3, 7):
|
||||
else:
|
||||
__all__ = (
|
||||
"AbstractEventLoopPolicy",
|
||||
"AbstractEventLoop",
|
||||
@@ -56,24 +54,6 @@ elif sys.version_info >= (3, 7):
|
||||
"_get_running_loop",
|
||||
)
|
||||
|
||||
else:
|
||||
__all__ = [
|
||||
"AbstractEventLoopPolicy",
|
||||
"AbstractEventLoop",
|
||||
"AbstractServer",
|
||||
"Handle",
|
||||
"TimerHandle",
|
||||
"get_event_loop_policy",
|
||||
"set_event_loop_policy",
|
||||
"get_event_loop",
|
||||
"set_event_loop",
|
||||
"new_event_loop",
|
||||
"get_child_watcher",
|
||||
"set_child_watcher",
|
||||
"_set_running_loop",
|
||||
"_get_running_loop",
|
||||
]
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_ProtocolT = TypeVar("_ProtocolT", bound=BaseProtocol)
|
||||
_Context: TypeAlias = dict[str, Any]
|
||||
@@ -89,35 +69,24 @@ class _TaskFactory(Protocol):
|
||||
class Handle:
|
||||
_cancelled: bool
|
||||
_args: Sequence[Any]
|
||||
if sys.version_info >= (3, 7):
|
||||
def __init__(
|
||||
self, callback: Callable[..., Any], args: Sequence[Any], loop: AbstractEventLoop, context: Context | None = ...
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, callback: Callable[..., Any], args: Sequence[Any], loop: AbstractEventLoop) -> None: ...
|
||||
|
||||
def __init__(
|
||||
self, callback: Callable[..., Any], args: Sequence[Any], loop: AbstractEventLoop, context: Context | None = ...
|
||||
) -> None: ...
|
||||
def cancel(self) -> None: ...
|
||||
def _run(self) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def cancelled(self) -> bool: ...
|
||||
def cancelled(self) -> bool: ...
|
||||
|
||||
class TimerHandle(Handle):
|
||||
if sys.version_info >= (3, 7):
|
||||
def __init__(
|
||||
self,
|
||||
when: float,
|
||||
callback: Callable[..., Any],
|
||||
args: Sequence[Any],
|
||||
loop: AbstractEventLoop,
|
||||
context: Context | None = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, when: float, callback: Callable[..., Any], args: Sequence[Any], loop: AbstractEventLoop) -> None: ...
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
when: float,
|
||||
callback: Callable[..., Any],
|
||||
args: Sequence[Any],
|
||||
loop: AbstractEventLoop,
|
||||
context: Context | None = ...,
|
||||
) -> None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def when(self) -> float: ...
|
||||
|
||||
def when(self) -> float: ...
|
||||
def __lt__(self, other: TimerHandle) -> bool: ...
|
||||
def __le__(self, other: TimerHandle) -> bool: ...
|
||||
def __gt__(self, other: TimerHandle) -> bool: ...
|
||||
@@ -127,18 +96,16 @@ class TimerHandle(Handle):
|
||||
class AbstractServer:
|
||||
@abstractmethod
|
||||
def close(self) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
async def __aenter__(self: Self) -> Self: ...
|
||||
async def __aexit__(self, *exc: object) -> None: ...
|
||||
@abstractmethod
|
||||
def get_loop(self) -> AbstractEventLoop: ...
|
||||
@abstractmethod
|
||||
def is_serving(self) -> bool: ...
|
||||
@abstractmethod
|
||||
async def start_serving(self) -> None: ...
|
||||
@abstractmethod
|
||||
async def serve_forever(self) -> None: ...
|
||||
|
||||
async def __aenter__(self: Self) -> Self: ...
|
||||
async def __aexit__(self, *exc: object) -> None: ...
|
||||
@abstractmethod
|
||||
def get_loop(self) -> AbstractEventLoop: ...
|
||||
@abstractmethod
|
||||
def is_serving(self) -> bool: ...
|
||||
@abstractmethod
|
||||
async def start_serving(self) -> None: ...
|
||||
@abstractmethod
|
||||
async def serve_forever(self) -> None: ...
|
||||
@abstractmethod
|
||||
async def wait_closed(self) -> None: ...
|
||||
|
||||
@@ -317,41 +284,6 @@ class AbstractEventLoop:
|
||||
happy_eyeballs_delay: float | None = ...,
|
||||
interleave: int | None = ...,
|
||||
) -> tuple[BaseTransport, _ProtocolT]: ...
|
||||
elif sys.version_info >= (3, 7):
|
||||
@overload
|
||||
@abstractmethod
|
||||
async def create_connection(
|
||||
self,
|
||||
protocol_factory: Callable[[], _ProtocolT],
|
||||
host: str = ...,
|
||||
port: int = ...,
|
||||
*,
|
||||
ssl: _SSLContext = ...,
|
||||
family: int = ...,
|
||||
proto: int = ...,
|
||||
flags: int = ...,
|
||||
sock: None = ...,
|
||||
local_addr: tuple[str, int] | None = ...,
|
||||
server_hostname: str | None = ...,
|
||||
ssl_handshake_timeout: float | None = ...,
|
||||
) -> tuple[BaseTransport, _ProtocolT]: ...
|
||||
@overload
|
||||
@abstractmethod
|
||||
async def create_connection(
|
||||
self,
|
||||
protocol_factory: Callable[[], _ProtocolT],
|
||||
host: None = ...,
|
||||
port: None = ...,
|
||||
*,
|
||||
ssl: _SSLContext = ...,
|
||||
family: int = ...,
|
||||
proto: int = ...,
|
||||
flags: int = ...,
|
||||
sock: socket,
|
||||
local_addr: None = ...,
|
||||
server_hostname: str | None = ...,
|
||||
ssl_handshake_timeout: float | None = ...,
|
||||
) -> tuple[BaseTransport, _ProtocolT]: ...
|
||||
else:
|
||||
@overload
|
||||
@abstractmethod
|
||||
@@ -368,6 +300,7 @@ class AbstractEventLoop:
|
||||
sock: None = ...,
|
||||
local_addr: tuple[str, int] | None = ...,
|
||||
server_hostname: str | None = ...,
|
||||
ssl_handshake_timeout: float | None = ...,
|
||||
) -> tuple[BaseTransport, _ProtocolT]: ...
|
||||
@overload
|
||||
@abstractmethod
|
||||
@@ -384,6 +317,7 @@ class AbstractEventLoop:
|
||||
sock: socket,
|
||||
local_addr: None = ...,
|
||||
server_hostname: str | None = ...,
|
||||
ssl_handshake_timeout: float | None = ...,
|
||||
) -> tuple[BaseTransport, _ProtocolT]: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
@overload
|
||||
@@ -448,7 +382,7 @@ class AbstractEventLoop:
|
||||
ssl_shutdown_timeout: float | None = ...,
|
||||
start_serving: bool = ...,
|
||||
) -> Server: ...
|
||||
elif sys.version_info >= (3, 7):
|
||||
else:
|
||||
@overload
|
||||
@abstractmethod
|
||||
async def create_server(
|
||||
@@ -507,48 +441,6 @@ class AbstractEventLoop:
|
||||
ssl_handshake_timeout: float | None = ...,
|
||||
start_serving: bool = ...,
|
||||
) -> Server: ...
|
||||
else:
|
||||
@overload
|
||||
@abstractmethod
|
||||
async def create_server(
|
||||
self,
|
||||
protocol_factory: _ProtocolFactory,
|
||||
host: str | Sequence[str] | None = ...,
|
||||
port: int = ...,
|
||||
*,
|
||||
family: int = ...,
|
||||
flags: int = ...,
|
||||
sock: None = ...,
|
||||
backlog: int = ...,
|
||||
ssl: _SSLContext = ...,
|
||||
reuse_address: bool | None = ...,
|
||||
reuse_port: bool | None = ...,
|
||||
) -> Server: ...
|
||||
@overload
|
||||
@abstractmethod
|
||||
async def create_server(
|
||||
self,
|
||||
protocol_factory: _ProtocolFactory,
|
||||
host: None = ...,
|
||||
port: None = ...,
|
||||
*,
|
||||
family: int = ...,
|
||||
flags: int = ...,
|
||||
sock: socket,
|
||||
backlog: int = ...,
|
||||
ssl: _SSLContext = ...,
|
||||
reuse_address: bool | None = ...,
|
||||
reuse_port: bool | None = ...,
|
||||
) -> Server: ...
|
||||
async def create_unix_server(
|
||||
self,
|
||||
protocol_factory: _ProtocolFactory,
|
||||
path: str,
|
||||
*,
|
||||
sock: socket | None = ...,
|
||||
backlog: int = ...,
|
||||
ssl: _SSLContext = ...,
|
||||
) -> Server: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
async def connect_accepted_socket(
|
||||
self,
|
||||
@@ -580,7 +472,7 @@ class AbstractEventLoop:
|
||||
ssl_handshake_timeout: float | None = ...,
|
||||
ssl_shutdown_timeout: float | None = ...,
|
||||
) -> tuple[BaseTransport, _ProtocolT]: ...
|
||||
elif sys.version_info >= (3, 7):
|
||||
else:
|
||||
async def create_unix_connection(
|
||||
self,
|
||||
protocol_factory: Callable[[], _ProtocolT],
|
||||
@@ -591,26 +483,15 @@ class AbstractEventLoop:
|
||||
server_hostname: str | None = ...,
|
||||
ssl_handshake_timeout: float | None = ...,
|
||||
) -> tuple[BaseTransport, _ProtocolT]: ...
|
||||
else:
|
||||
async def create_unix_connection(
|
||||
self,
|
||||
protocol_factory: Callable[[], _ProtocolT],
|
||||
path: str,
|
||||
*,
|
||||
ssl: _SSLContext = ...,
|
||||
sock: socket | None = ...,
|
||||
server_hostname: str | None = ...,
|
||||
) -> tuple[BaseTransport, _ProtocolT]: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
@abstractmethod
|
||||
async def sock_sendfile(
|
||||
self, sock: socket, file: IO[bytes], offset: int = ..., count: int | None = ..., *, fallback: bool | None = ...
|
||||
) -> int: ...
|
||||
@abstractmethod
|
||||
async def sendfile(
|
||||
self, transport: BaseTransport, file: IO[bytes], offset: int = ..., count: int | None = ..., *, fallback: bool = ...
|
||||
) -> int: ...
|
||||
|
||||
@abstractmethod
|
||||
async def sock_sendfile(
|
||||
self, sock: socket, file: IO[bytes], offset: int = ..., count: int | None = ..., *, fallback: bool | None = ...
|
||||
) -> int: ...
|
||||
@abstractmethod
|
||||
async def sendfile(
|
||||
self, transport: BaseTransport, file: IO[bytes], offset: int = ..., count: int | None = ..., *, fallback: bool = ...
|
||||
) -> int: ...
|
||||
@abstractmethod
|
||||
async def create_datagram_endpoint(
|
||||
self,
|
||||
@@ -677,26 +558,16 @@ class AbstractEventLoop:
|
||||
@abstractmethod
|
||||
def remove_writer(self, fd: FileDescriptorLike) -> bool: ...
|
||||
# Completion based I/O methods returning Futures prior to 3.7
|
||||
if sys.version_info >= (3, 7):
|
||||
@abstractmethod
|
||||
async def sock_recv(self, sock: socket, nbytes: int) -> bytes: ...
|
||||
@abstractmethod
|
||||
async def sock_recv_into(self, sock: socket, buf: WriteableBuffer) -> int: ...
|
||||
@abstractmethod
|
||||
async def sock_sendall(self, sock: socket, data: bytes) -> None: ...
|
||||
@abstractmethod
|
||||
async def sock_connect(self, sock: socket, address: _Address) -> None: ...
|
||||
@abstractmethod
|
||||
async def sock_accept(self, sock: socket) -> tuple[socket, _RetAddress]: ...
|
||||
else:
|
||||
@abstractmethod
|
||||
def sock_recv(self, sock: socket, nbytes: int) -> Future[bytes]: ...
|
||||
@abstractmethod
|
||||
def sock_sendall(self, sock: socket, data: bytes) -> Future[None]: ...
|
||||
@abstractmethod
|
||||
def sock_connect(self, sock: socket, address: _Address) -> Future[None]: ...
|
||||
@abstractmethod
|
||||
def sock_accept(self, sock: socket) -> Future[tuple[socket, _RetAddress]]: ...
|
||||
@abstractmethod
|
||||
async def sock_recv(self, sock: socket, nbytes: int) -> bytes: ...
|
||||
@abstractmethod
|
||||
async def sock_recv_into(self, sock: socket, buf: WriteableBuffer) -> int: ...
|
||||
@abstractmethod
|
||||
async def sock_sendall(self, sock: socket, data: bytes) -> None: ...
|
||||
@abstractmethod
|
||||
async def sock_connect(self, sock: socket, address: _Address) -> None: ...
|
||||
@abstractmethod
|
||||
async def sock_accept(self, sock: socket) -> tuple[socket, _RetAddress]: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
@abstractmethod
|
||||
async def sock_recvfrom(self, sock: socket, bufsize: int) -> bytes: ...
|
||||
@@ -755,8 +626,7 @@ def get_child_watcher() -> AbstractChildWatcher: ...
|
||||
def set_child_watcher(watcher: AbstractChildWatcher) -> None: ...
|
||||
def _set_running_loop(__loop: AbstractEventLoop | None) -> None: ...
|
||||
def _get_running_loop() -> AbstractEventLoop: ...
|
||||
def get_running_loop() -> AbstractEventLoop: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def get_running_loop() -> AbstractEventLoop: ...
|
||||
if sys.version_info < (3, 8):
|
||||
class SendfileNotAvailableError(RuntimeError): ...
|
||||
if sys.version_info < (3, 8):
|
||||
class SendfileNotAvailableError(RuntimeError): ...
|
||||
|
||||
@@ -12,18 +12,15 @@ if sys.version_info < (3, 8):
|
||||
|
||||
class InvalidStateError(Error): ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from contextvars import Context
|
||||
from contextvars import Context
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
__all__ = ("Future", "wrap_future", "isfuture")
|
||||
elif sys.version_info >= (3, 7):
|
||||
__all__ = ("CancelledError", "TimeoutError", "InvalidStateError", "Future", "wrap_future", "isfuture")
|
||||
else:
|
||||
__all__ = ["CancelledError", "TimeoutError", "InvalidStateError", "Future", "wrap_future", "isfuture"]
|
||||
__all__ = ("CancelledError", "TimeoutError", "InvalidStateError", "Future", "wrap_future", "isfuture")
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@@ -32,15 +29,6 @@ _T = TypeVar("_T")
|
||||
# That's why the import order is reversed.
|
||||
def isfuture(obj: object) -> TypeGuard[Future[Any]]: ...
|
||||
|
||||
if sys.version_info < (3, 7):
|
||||
class _TracebackLogger:
|
||||
exc: BaseException
|
||||
tb: list[str]
|
||||
def __init__(self, exc: Any, loop: AbstractEventLoop) -> None: ...
|
||||
def activate(self) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
def __del__(self) -> None: ...
|
||||
|
||||
class Future(Awaitable[_T], Iterable[_T]):
|
||||
_state: str
|
||||
@property
|
||||
@@ -53,15 +41,10 @@ class Future(Awaitable[_T], Iterable[_T]):
|
||||
_asyncio_future_blocking: bool # is a part of duck-typing contract for `Future`
|
||||
def __init__(self, *, loop: AbstractEventLoop | None = ...) -> None: ...
|
||||
def __del__(self) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def get_loop(self) -> AbstractEventLoop: ...
|
||||
@property
|
||||
def _callbacks(self: Self) -> list[tuple[Callable[[Self], Any], Context]]: ...
|
||||
def add_done_callback(self: Self, __fn: Callable[[Self], Any], *, context: Context | None = ...) -> None: ...
|
||||
else:
|
||||
@property
|
||||
def _callbacks(self: Self) -> list[Callable[[Self], Any]]: ...
|
||||
def add_done_callback(self: Self, __fn: Callable[[Self], Any]) -> None: ...
|
||||
def get_loop(self) -> AbstractEventLoop: ...
|
||||
@property
|
||||
def _callbacks(self: Self) -> list[tuple[Callable[[Self], Any], Context]]: ...
|
||||
def add_done_callback(self: Self, __fn: Callable[[Self], Any], *, context: Context | None = ...) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def cancel(self, msg: Any | None = ...) -> bool: ...
|
||||
else:
|
||||
|
||||
@@ -15,10 +15,8 @@ if sys.version_info >= (3, 11):
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
__all__ = ("Lock", "Event", "Condition", "Semaphore", "BoundedSemaphore", "Barrier")
|
||||
elif sys.version_info >= (3, 7):
|
||||
__all__ = ("Lock", "Event", "Condition", "Semaphore", "BoundedSemaphore")
|
||||
else:
|
||||
__all__ = ["Lock", "Event", "Condition", "Semaphore", "BoundedSemaphore"]
|
||||
__all__ = ("Lock", "Event", "Condition", "Semaphore", "BoundedSemaphore")
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
|
||||
@@ -6,10 +6,7 @@ from typing_extensions import Literal
|
||||
|
||||
from . import base_events, constants, events, futures, streams, transports
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ = ("BaseProactorEventLoop",)
|
||||
else:
|
||||
__all__ = ["BaseProactorEventLoop"]
|
||||
__all__ = ("BaseProactorEventLoop",)
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
class _WarnCallbackProtocol(Protocol):
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import sys
|
||||
from _typeshed import ReadableBuffer
|
||||
from asyncio import transports
|
||||
from typing import Any
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ = ("BaseProtocol", "Protocol", "DatagramProtocol", "SubprocessProtocol", "BufferedProtocol")
|
||||
else:
|
||||
__all__ = ["BaseProtocol", "Protocol", "DatagramProtocol", "SubprocessProtocol"]
|
||||
__all__ = ("BaseProtocol", "Protocol", "DatagramProtocol", "SubprocessProtocol", "BufferedProtocol")
|
||||
|
||||
class BaseProtocol:
|
||||
def connection_made(self, transport: transports.BaseTransport) -> None: ...
|
||||
@@ -18,11 +14,10 @@ class Protocol(BaseProtocol):
|
||||
def data_received(self, data: bytes) -> None: ...
|
||||
def eof_received(self) -> bool | None: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
class BufferedProtocol(BaseProtocol):
|
||||
def get_buffer(self, sizehint: int) -> ReadableBuffer: ...
|
||||
def buffer_updated(self, nbytes: int) -> None: ...
|
||||
def eof_received(self) -> bool | None: ...
|
||||
class BufferedProtocol(BaseProtocol):
|
||||
def get_buffer(self, sizehint: int) -> ReadableBuffer: ...
|
||||
def buffer_updated(self, nbytes: int) -> None: ...
|
||||
def eof_received(self) -> bool | None: ...
|
||||
|
||||
class DatagramProtocol(BaseProtocol):
|
||||
def connection_made(self, transport: transports.DatagramTransport) -> None: ... # type: ignore[override]
|
||||
|
||||
@@ -5,10 +5,7 @@ from typing import Any, Generic, TypeVar
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ = ("Queue", "PriorityQueue", "LifoQueue", "QueueFull", "QueueEmpty")
|
||||
else:
|
||||
__all__ = ["Queue", "PriorityQueue", "LifoQueue", "QueueFull", "QueueEmpty"]
|
||||
__all__ = ("Queue", "PriorityQueue", "LifoQueue", "QueueFull", "QueueEmpty")
|
||||
|
||||
class QueueEmpty(Exception): ...
|
||||
class QueueFull(Exception): ...
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import selectors
|
||||
import sys
|
||||
|
||||
from . import base_events
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ = ("BaseSelectorEventLoop",)
|
||||
else:
|
||||
__all__ = ["BaseSelectorEventLoop"]
|
||||
__all__ = ("BaseSelectorEventLoop",)
|
||||
|
||||
class BaseSelectorEventLoop(base_events.BaseEventLoop):
|
||||
def __init__(self, selector: selectors.BaseSelector | None = ...) -> None: ...
|
||||
|
||||
@@ -76,17 +76,13 @@ class _SSLProtocolTransport(transports._FlowControlMixin, transports.Transport):
|
||||
def get_protocol(self) -> protocols.BaseProtocol: ...
|
||||
def is_closing(self) -> bool: ...
|
||||
def close(self) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def is_reading(self) -> bool: ...
|
||||
|
||||
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: ...
|
||||
def get_write_buffer_size(self) -> int: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
@property
|
||||
def _protocol_paused(self) -> bool: ...
|
||||
|
||||
@property
|
||||
def _protocol_paused(self) -> bool: ...
|
||||
def write(self, data: bytes) -> None: ...
|
||||
def can_write_eof(self) -> Literal[False]: ...
|
||||
def abort(self) -> None: ...
|
||||
@@ -138,7 +134,7 @@ class SSLProtocol(_SSLProtocolBase):
|
||||
ssl_handshake_timeout: int | None = ...,
|
||||
ssl_shutdown_timeout: float | None = ...,
|
||||
) -> None: ...
|
||||
elif sys.version_info >= (3, 7):
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
loop: events.AbstractEventLoop,
|
||||
@@ -150,20 +146,8 @@ class SSLProtocol(_SSLProtocolBase):
|
||||
call_connection_made: bool = ...,
|
||||
ssl_handshake_timeout: int | None = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
loop: events.AbstractEventLoop,
|
||||
app_protocol: protocols.BaseProtocol,
|
||||
sslcontext: ssl.SSLContext,
|
||||
waiter: futures.Future[Any],
|
||||
server_side: bool = ...,
|
||||
server_hostname: str | None = ...,
|
||||
call_connection_made: bool = ...,
|
||||
) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def _set_app_protocol(self, app_protocol: protocols.BaseProtocol) -> None: ...
|
||||
|
||||
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: ...
|
||||
@@ -178,9 +162,7 @@ class SSLProtocol(_SSLProtocolBase):
|
||||
def _write_appdata(self, data: bytes) -> None: ...
|
||||
|
||||
def _start_handshake(self) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def _check_handshake_timeout(self) -> None: ...
|
||||
|
||||
def _check_handshake_timeout(self) -> None: ...
|
||||
def _on_handshake_complete(self, handshake_exc: BaseException | None) -> None: ...
|
||||
def _fatal_error(self, exc: BaseException, message: str = ...) -> None: ...
|
||||
def _abort(self) -> None: ...
|
||||
|
||||
@@ -11,7 +11,7 @@ from .base_events import Server
|
||||
if sys.platform == "win32":
|
||||
if sys.version_info >= (3, 8):
|
||||
__all__ = ("StreamReader", "StreamWriter", "StreamReaderProtocol", "open_connection", "start_server")
|
||||
elif sys.version_info >= (3, 7):
|
||||
else:
|
||||
__all__ = (
|
||||
"StreamReader",
|
||||
"StreamWriter",
|
||||
@@ -21,16 +21,6 @@ if sys.platform == "win32":
|
||||
"IncompleteReadError",
|
||||
"LimitOverrunError",
|
||||
)
|
||||
else:
|
||||
__all__ = [
|
||||
"StreamReader",
|
||||
"StreamWriter",
|
||||
"StreamReaderProtocol",
|
||||
"open_connection",
|
||||
"start_server",
|
||||
"IncompleteReadError",
|
||||
"LimitOverrunError",
|
||||
]
|
||||
else:
|
||||
if sys.version_info >= (3, 8):
|
||||
__all__ = (
|
||||
@@ -42,7 +32,7 @@ else:
|
||||
"open_unix_connection",
|
||||
"start_unix_server",
|
||||
)
|
||||
elif sys.version_info >= (3, 7):
|
||||
else:
|
||||
__all__ = (
|
||||
"StreamReader",
|
||||
"StreamWriter",
|
||||
@@ -54,18 +44,6 @@ else:
|
||||
"open_unix_connection",
|
||||
"start_unix_server",
|
||||
)
|
||||
else:
|
||||
__all__ = [
|
||||
"StreamReader",
|
||||
"StreamWriter",
|
||||
"StreamReaderProtocol",
|
||||
"open_connection",
|
||||
"start_server",
|
||||
"IncompleteReadError",
|
||||
"LimitOverrunError",
|
||||
"open_unix_connection",
|
||||
"start_unix_server",
|
||||
]
|
||||
|
||||
_ClientConnectedCallback: TypeAlias = Callable[[StreamReader, StreamWriter], Awaitable[None] | None]
|
||||
|
||||
@@ -120,24 +98,20 @@ else:
|
||||
) -> Server: ...
|
||||
|
||||
if sys.platform != "win32":
|
||||
if sys.version_info >= (3, 7):
|
||||
_PathType: TypeAlias = StrPath
|
||||
else:
|
||||
_PathType: TypeAlias = str
|
||||
if sys.version_info >= (3, 10):
|
||||
async def open_unix_connection(
|
||||
path: _PathType | None = ..., *, limit: int = ..., **kwds: Any
|
||||
path: StrPath | None = ..., *, limit: int = ..., **kwds: Any
|
||||
) -> tuple[StreamReader, StreamWriter]: ...
|
||||
async def start_unix_server(
|
||||
client_connected_cb: _ClientConnectedCallback, path: _PathType | None = ..., *, limit: int = ..., **kwds: Any
|
||||
client_connected_cb: _ClientConnectedCallback, path: StrPath | None = ..., *, limit: int = ..., **kwds: Any
|
||||
) -> Server: ...
|
||||
else:
|
||||
async def open_unix_connection(
|
||||
path: _PathType | None = ..., *, loop: events.AbstractEventLoop | None = ..., limit: int = ..., **kwds: Any
|
||||
path: StrPath | None = ..., *, loop: events.AbstractEventLoop | None = ..., limit: int = ..., **kwds: Any
|
||||
) -> tuple[StreamReader, StreamWriter]: ...
|
||||
async def start_unix_server(
|
||||
client_connected_cb: _ClientConnectedCallback,
|
||||
path: _PathType | None = ...,
|
||||
path: StrPath | None = ...,
|
||||
*,
|
||||
loop: events.AbstractEventLoop | None = ...,
|
||||
limit: int = ...,
|
||||
@@ -174,10 +148,8 @@ class StreamWriter:
|
||||
def write_eof(self) -> None: ...
|
||||
def can_write_eof(self) -> bool: ...
|
||||
def close(self) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def is_closing(self) -> bool: ...
|
||||
async def wait_closed(self) -> None: ...
|
||||
|
||||
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: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
|
||||
@@ -6,10 +6,7 @@ from collections.abc import Callable
|
||||
from typing import IO, Any
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ = ("create_subprocess_exec", "create_subprocess_shell")
|
||||
else:
|
||||
__all__ = ["create_subprocess_exec", "create_subprocess_shell"]
|
||||
__all__ = ("create_subprocess_exec", "create_subprocess_shell")
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
_ExecArg: TypeAlias = StrOrBytesPath
|
||||
|
||||
+38
-57
@@ -13,43 +13,27 @@ if sys.version_info >= (3, 9):
|
||||
if sys.version_info >= (3, 11):
|
||||
from contextvars import Context
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ = (
|
||||
"Task",
|
||||
"create_task",
|
||||
"FIRST_COMPLETED",
|
||||
"FIRST_EXCEPTION",
|
||||
"ALL_COMPLETED",
|
||||
"wait",
|
||||
"wait_for",
|
||||
"as_completed",
|
||||
"sleep",
|
||||
"gather",
|
||||
"shield",
|
||||
"ensure_future",
|
||||
"run_coroutine_threadsafe",
|
||||
"current_task",
|
||||
"all_tasks",
|
||||
"_register_task",
|
||||
"_unregister_task",
|
||||
"_enter_task",
|
||||
"_leave_task",
|
||||
)
|
||||
else:
|
||||
__all__ = [
|
||||
"Task",
|
||||
"FIRST_COMPLETED",
|
||||
"FIRST_EXCEPTION",
|
||||
"ALL_COMPLETED",
|
||||
"wait",
|
||||
"wait_for",
|
||||
"as_completed",
|
||||
"sleep",
|
||||
"gather",
|
||||
"shield",
|
||||
"ensure_future",
|
||||
"run_coroutine_threadsafe",
|
||||
]
|
||||
__all__ = (
|
||||
"Task",
|
||||
"create_task",
|
||||
"FIRST_COMPLETED",
|
||||
"FIRST_EXCEPTION",
|
||||
"ALL_COMPLETED",
|
||||
"wait",
|
||||
"wait_for",
|
||||
"as_completed",
|
||||
"sleep",
|
||||
"gather",
|
||||
"shield",
|
||||
"ensure_future",
|
||||
"run_coroutine_threadsafe",
|
||||
"current_task",
|
||||
"all_tasks",
|
||||
"_register_task",
|
||||
"_unregister_task",
|
||||
"_enter_task",
|
||||
"_leave_task",
|
||||
)
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_T1 = TypeVar("_T1")
|
||||
@@ -78,9 +62,6 @@ def ensure_future(coro_or_future: _FT, *, loop: AbstractEventLoop | None = ...)
|
||||
@overload
|
||||
def ensure_future(coro_or_future: Awaitable[_T], *, loop: AbstractEventLoop | None = ...) -> Task[_T]: ...
|
||||
|
||||
# Prior to Python 3.7 'async' was an alias for 'ensure_future'.
|
||||
# It became a keyword in 3.7.
|
||||
|
||||
# `gather()` actually returns a list with length equal to the number
|
||||
# of tasks passed; however, Tuple is used similar to the annotation for
|
||||
# zip() because typing does not support variadic type variables. See
|
||||
@@ -334,24 +315,24 @@ class Task(Future[_T], Generic[_T]):
|
||||
def current_task(cls, loop: AbstractEventLoop | None = ...) -> Task[Any] | None: ...
|
||||
@classmethod
|
||||
def all_tasks(cls, loop: AbstractEventLoop | None = ...) -> set[Task[Any]]: ...
|
||||
if sys.version_info < (3, 7):
|
||||
def _wakeup(self, fut: Future[Any]) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def all_tasks(loop: AbstractEventLoop | None = ...) -> set[Task[Any]]: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def create_task(
|
||||
coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T], *, name: str | None = ..., context: Context | None = ...
|
||||
) -> Task[_T]: ...
|
||||
elif sys.version_info >= (3, 8):
|
||||
def create_task(coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T], *, name: str | None = ...) -> Task[_T]: ...
|
||||
else:
|
||||
def create_task(coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T]) -> Task[_T]: ...
|
||||
def all_tasks(loop: AbstractEventLoop | None = ...) -> set[Task[Any]]: ...
|
||||
|
||||
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: ...
|
||||
def _register_task(task: Task[Any]) -> None: ...
|
||||
def _unregister_task(task: Task[Any]) -> None: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def create_task(
|
||||
coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T], *, name: str | None = ..., context: Context | None = ...
|
||||
) -> Task[_T]: ...
|
||||
|
||||
elif sys.version_info >= (3, 8):
|
||||
def create_task(coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T], *, name: str | None = ...) -> Task[_T]: ...
|
||||
|
||||
else:
|
||||
def create_task(coro: Generator[Any, None, _T] | Coroutine[Any, Any, _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: ...
|
||||
def _register_task(task: Task[Any]) -> None: ...
|
||||
def _unregister_task(task: Task[Any]) -> None: ...
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
import sys
|
||||
from asyncio.events import AbstractEventLoop
|
||||
from asyncio.protocols import BaseProtocol
|
||||
from collections.abc import Mapping
|
||||
from socket import _Address
|
||||
from typing import Any
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ = ("BaseTransport", "ReadTransport", "WriteTransport", "Transport", "DatagramTransport", "SubprocessTransport")
|
||||
else:
|
||||
__all__ = ["BaseTransport", "ReadTransport", "WriteTransport", "Transport", "DatagramTransport", "SubprocessTransport"]
|
||||
__all__ = ("BaseTransport", "ReadTransport", "WriteTransport", "Transport", "DatagramTransport", "SubprocessTransport")
|
||||
|
||||
class BaseTransport:
|
||||
def __init__(self, extra: Mapping[Any, Any] | None = ...) -> None: ...
|
||||
@@ -19,9 +15,7 @@ class BaseTransport:
|
||||
def get_protocol(self) -> BaseProtocol: ...
|
||||
|
||||
class ReadTransport(BaseTransport):
|
||||
if sys.version_info >= (3, 7):
|
||||
def is_reading(self) -> bool: ...
|
||||
|
||||
def is_reading(self) -> bool: ...
|
||||
def pause_reading(self) -> None: ...
|
||||
def resume_reading(self) -> None: ...
|
||||
|
||||
|
||||
@@ -3,12 +3,10 @@ import types
|
||||
from _typeshed import Self
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from collections.abc import Callable
|
||||
from socket import socket
|
||||
from typing import Any
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .base_events import Server
|
||||
from .events import AbstractEventLoop, BaseDefaultEventLoopPolicy, _ProtocolFactory, _SSLContext
|
||||
from .events import AbstractEventLoop, BaseDefaultEventLoopPolicy
|
||||
from .selector_events import BaseSelectorEventLoop
|
||||
|
||||
# This is also technically not available on Win,
|
||||
@@ -53,10 +51,8 @@ if sys.platform != "win32":
|
||||
"ThreadedChildWatcher",
|
||||
"DefaultEventLoopPolicy",
|
||||
)
|
||||
elif sys.version_info >= (3, 7):
|
||||
__all__ = ("SelectorEventLoop", "AbstractChildWatcher", "SafeChildWatcher", "FastChildWatcher", "DefaultEventLoopPolicy")
|
||||
else:
|
||||
__all__ = ["SelectorEventLoop", "AbstractChildWatcher", "SafeChildWatcher", "FastChildWatcher", "DefaultEventLoopPolicy"]
|
||||
__all__ = ("SelectorEventLoop", "AbstractChildWatcher", "SafeChildWatcher", "FastChildWatcher", "DefaultEventLoopPolicy")
|
||||
|
||||
# Doesn't actually have ABCMeta metaclass at runtime, but mypy complains if we don't have it in the stub.
|
||||
# See discussion in #7412
|
||||
@@ -80,17 +76,7 @@ if sys.platform != "win32":
|
||||
def add_child_handler(self, pid: int, callback: Callable[..., Any], *args: Any) -> None: ...
|
||||
def remove_child_handler(self, pid: int) -> bool: ...
|
||||
|
||||
class _UnixSelectorEventLoop(BaseSelectorEventLoop):
|
||||
if sys.version_info < (3, 7):
|
||||
async def create_unix_server(
|
||||
self,
|
||||
protocol_factory: _ProtocolFactory,
|
||||
path: str | None = ...,
|
||||
*,
|
||||
sock: socket | None = ...,
|
||||
backlog: int = ...,
|
||||
ssl: _SSLContext = ...,
|
||||
) -> Server: ...
|
||||
class _UnixSelectorEventLoop(BaseSelectorEventLoop): ...
|
||||
|
||||
class _UnixDefaultEventLoopPolicy(BaseDefaultEventLoopPolicy):
|
||||
def get_child_watcher(self) -> AbstractChildWatcher: ...
|
||||
|
||||
@@ -8,17 +8,14 @@ from typing_extensions import Literal
|
||||
from . import events, futures, proactor_events, selector_events, streams, windows_utils
|
||||
|
||||
if sys.platform == "win32":
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ = (
|
||||
"SelectorEventLoop",
|
||||
"ProactorEventLoop",
|
||||
"IocpProactor",
|
||||
"DefaultEventLoopPolicy",
|
||||
"WindowsSelectorEventLoopPolicy",
|
||||
"WindowsProactorEventLoopPolicy",
|
||||
)
|
||||
else:
|
||||
__all__ = ["SelectorEventLoop", "ProactorEventLoop", "IocpProactor", "DefaultEventLoopPolicy"]
|
||||
__all__ = (
|
||||
"SelectorEventLoop",
|
||||
"ProactorEventLoop",
|
||||
"IocpProactor",
|
||||
"DefaultEventLoopPolicy",
|
||||
"WindowsSelectorEventLoopPolicy",
|
||||
"WindowsProactorEventLoopPolicy",
|
||||
)
|
||||
|
||||
NULL: Literal[0]
|
||||
INFINITE: Literal[0xFFFFFFFF]
|
||||
@@ -50,35 +47,24 @@ if sys.platform == "win32":
|
||||
def set_loop(self, loop: events.AbstractEventLoop) -> None: ...
|
||||
def select(self, timeout: int | None = ...) -> list[futures.Future[Any]]: ...
|
||||
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 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 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: ...
|
||||
def close(self) -> None: ...
|
||||
SelectorEventLoop = _WindowsSelectorEventLoop
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
class WindowsSelectorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
|
||||
_loop_factory: ClassVar[type[SelectorEventLoop]]
|
||||
def get_child_watcher(self) -> NoReturn: ...
|
||||
def set_child_watcher(self, watcher: Any) -> NoReturn: ...
|
||||
class WindowsSelectorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
|
||||
_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: ...
|
||||
def set_child_watcher(self, watcher: Any) -> NoReturn: ...
|
||||
DefaultEventLoopPolicy = WindowsSelectorEventLoopPolicy
|
||||
else:
|
||||
class _WindowsDefaultEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
|
||||
_loop_factory: ClassVar[type[SelectorEventLoop]]
|
||||
def get_child_watcher(self) -> NoReturn: ...
|
||||
def set_child_watcher(self, watcher: Any) -> NoReturn: ...
|
||||
DefaultEventLoopPolicy = _WindowsDefaultEventLoopPolicy
|
||||
class WindowsProactorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
|
||||
_loop_factory: ClassVar[type[ProactorEventLoop]]
|
||||
def get_child_watcher(self) -> NoReturn: ...
|
||||
def set_child_watcher(self, watcher: Any) -> NoReturn: ...
|
||||
DefaultEventLoopPolicy = WindowsSelectorEventLoopPolicy
|
||||
|
||||
@@ -7,13 +7,7 @@ from typing import Any, AnyStr, Protocol
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.platform == "win32":
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ = ("pipe", "Popen", "PIPE", "PipeHandle")
|
||||
else:
|
||||
__all__ = ["socketpair", "pipe", "Popen", "PIPE", "PipeHandle"]
|
||||
import socket
|
||||
|
||||
socketpair = socket.socketpair
|
||||
__all__ = ("pipe", "Popen", "PIPE", "PipeHandle")
|
||||
|
||||
class _WarnFunction(Protocol):
|
||||
def __call__(
|
||||
|
||||
+1
-6
@@ -7,12 +7,7 @@ from typing_extensions import TypeAlias
|
||||
_AsciiBuffer: TypeAlias = str | ReadableBuffer
|
||||
|
||||
def a2b_uu(__data: _AsciiBuffer) -> bytes: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def b2a_uu(__data: ReadableBuffer, *, backtick: bool = ...) -> bytes: ...
|
||||
|
||||
else:
|
||||
def b2a_uu(__data: ReadableBuffer) -> bytes: ...
|
||||
def b2a_uu(__data: ReadableBuffer, *, backtick: bool = ...) -> bytes: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
def a2b_base64(__data: _AsciiBuffer, *, strict_mode: bool = ...) -> bytes: ...
|
||||
|
||||
+4
-13
@@ -438,9 +438,7 @@ class str(Sequence[str]):
|
||||
def index(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
|
||||
def isalnum(self) -> bool: ...
|
||||
def isalpha(self) -> bool: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def isascii(self) -> bool: ...
|
||||
|
||||
def isascii(self) -> bool: ...
|
||||
def isdecimal(self) -> bool: ...
|
||||
def isdigit(self) -> bool: ...
|
||||
def isidentifier(self) -> bool: ...
|
||||
@@ -616,9 +614,7 @@ class bytes(ByteString):
|
||||
) -> int: ...
|
||||
def isalnum(self) -> bool: ...
|
||||
def isalpha(self) -> bool: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def isascii(self) -> bool: ...
|
||||
|
||||
def isascii(self) -> bool: ...
|
||||
def isdigit(self) -> bool: ...
|
||||
def islower(self) -> bool: ...
|
||||
def isspace(self) -> bool: ...
|
||||
@@ -728,9 +724,7 @@ class bytearray(MutableSequence[int], ByteString):
|
||||
def insert(self, __index: SupportsIndex, __item: SupportsIndex) -> None: ...
|
||||
def isalnum(self) -> bool: ...
|
||||
def isalpha(self) -> bool: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def isascii(self) -> bool: ...
|
||||
|
||||
def isascii(self) -> bool: ...
|
||||
def isdigit(self) -> bool: ...
|
||||
def islower(self) -> bool: ...
|
||||
def isspace(self) -> bool: ...
|
||||
@@ -1195,10 +1189,7 @@ def all(__iterable: Iterable[object]) -> bool: ...
|
||||
def any(__iterable: Iterable[object]) -> bool: ...
|
||||
def ascii(__obj: object) -> str: ...
|
||||
def bin(__number: int | SupportsIndex) -> str: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def breakpoint(*args: Any, **kws: Any) -> None: ...
|
||||
|
||||
def breakpoint(*args: Any, **kws: Any) -> None: ...
|
||||
def callable(__obj: object) -> TypeGuard[Callable[..., object]]: ...
|
||||
def chr(__i: int) -> str: ...
|
||||
|
||||
|
||||
+9
-11
@@ -62,9 +62,8 @@ class Calendar:
|
||||
def yeardatescalendar(self, year: int, width: int = ...) -> list[list[int]]: ...
|
||||
def yeardays2calendar(self, year: int, width: int = ...) -> list[list[tuple[int, int]]]: ...
|
||||
def yeardayscalendar(self, year: int, width: int = ...) -> list[list[int]]: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def itermonthdays3(self, year: int, month: int) -> Iterable[tuple[int, int, int]]: ...
|
||||
def itermonthdays4(self, year: int, month: int) -> Iterable[tuple[int, int, int, int]]: ...
|
||||
def itermonthdays3(self, year: int, month: int) -> Iterable[tuple[int, int, int]]: ...
|
||||
def itermonthdays4(self, year: int, month: int) -> Iterable[tuple[int, int, int, int]]: ...
|
||||
|
||||
class TextCalendar(Calendar):
|
||||
def prweek(self, theweek: int, width: int) -> None: ...
|
||||
@@ -97,14 +96,13 @@ class HTMLCalendar(Calendar):
|
||||
def formatmonth(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ...
|
||||
def formatyear(self, theyear: int, width: int = ...) -> str: ...
|
||||
def formatyearpage(self, theyear: int, width: int = ..., css: str | None = ..., encoding: str | None = ...) -> str: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
cssclasses: list[str]
|
||||
cssclass_noday: str
|
||||
cssclasses_weekday_head: list[str]
|
||||
cssclass_month_head: str
|
||||
cssclass_month: str
|
||||
cssclass_year: str
|
||||
cssclass_year_head: str
|
||||
cssclasses: list[str]
|
||||
cssclass_noday: str
|
||||
cssclasses_weekday_head: list[str]
|
||||
cssclass_month_head: str
|
||||
cssclass_month: str
|
||||
cssclass_year: str
|
||||
cssclass_year_head: str
|
||||
|
||||
class different_locale:
|
||||
def __init__(self, locale: _LocaleType) -> None: ...
|
||||
|
||||
+3
-7
@@ -35,13 +35,9 @@ if sys.version_info < (3, 8):
|
||||
def parse_qs(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> dict[str, list[str]]: ...
|
||||
def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> list[tuple[str, str]]: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def parse_multipart(
|
||||
fp: IO[Any], pdict: SupportsGetItem[str, bytes], encoding: str = ..., errors: str = ..., separator: str = ...
|
||||
) -> dict[str, list[Any]]: ...
|
||||
|
||||
else:
|
||||
def parse_multipart(fp: IO[Any], pdict: SupportsGetItem[str, bytes]) -> dict[str, list[bytes]]: ...
|
||||
def parse_multipart(
|
||||
fp: IO[Any], pdict: SupportsGetItem[str, bytes], encoding: str = ..., errors: str = ..., separator: str = ...
|
||||
) -> dict[str, list[Any]]: ...
|
||||
|
||||
class _Environ(Protocol):
|
||||
def __getitem__(self, __k: str) -> str: ...
|
||||
|
||||
@@ -14,35 +14,6 @@ else:
|
||||
|
||||
__all__ = ["ChainMap", "Counter", "OrderedDict", "UserDict", "UserList", "UserString", "defaultdict", "deque", "namedtuple"]
|
||||
|
||||
if sys.version_info < (3, 7):
|
||||
__all__ += [
|
||||
"Awaitable",
|
||||
"Coroutine",
|
||||
"AsyncIterable",
|
||||
"AsyncIterator",
|
||||
"AsyncGenerator",
|
||||
"Hashable",
|
||||
"Iterable",
|
||||
"Iterator",
|
||||
"Generator",
|
||||
"Reversible",
|
||||
"Sized",
|
||||
"Container",
|
||||
"Callable",
|
||||
"Collection",
|
||||
"Set",
|
||||
"MutableSet",
|
||||
"Mapping",
|
||||
"MutableMapping",
|
||||
"MappingView",
|
||||
"KeysView",
|
||||
"ItemsView",
|
||||
"ValuesView",
|
||||
"Sequence",
|
||||
"MutableSequence",
|
||||
"ByteString",
|
||||
]
|
||||
|
||||
_S = TypeVar("_S")
|
||||
_T = TypeVar("_T")
|
||||
_T1 = TypeVar("_T1")
|
||||
@@ -53,20 +24,14 @@ _KT_co = TypeVar("_KT_co", covariant=True)
|
||||
_VT_co = TypeVar("_VT_co", covariant=True)
|
||||
|
||||
# namedtuple is special-cased in the type checker; the initializer is ignored.
|
||||
if sys.version_info >= (3, 7):
|
||||
def namedtuple(
|
||||
typename: str,
|
||||
field_names: str | Iterable[str],
|
||||
*,
|
||||
rename: bool = ...,
|
||||
module: str | None = ...,
|
||||
defaults: Iterable[Any] | None = ...,
|
||||
) -> type[tuple[Any, ...]]: ...
|
||||
|
||||
else:
|
||||
def namedtuple(
|
||||
typename: str, field_names: str | Iterable[str], *, verbose: bool = ..., rename: bool = ..., module: str | None = ...
|
||||
) -> type[tuple[Any, ...]]: ...
|
||||
def namedtuple(
|
||||
typename: str,
|
||||
field_names: str | Iterable[str],
|
||||
*,
|
||||
rename: bool = ...,
|
||||
module: str | None = ...,
|
||||
defaults: Iterable[Any] | None = ...,
|
||||
) -> type[tuple[Any, ...]]: ...
|
||||
|
||||
class UserDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
data: dict[_KT, _VT]
|
||||
@@ -88,8 +53,7 @@ class UserDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
def __iter__(self) -> Iterator[_KT]: ...
|
||||
def __contains__(self, key: object) -> bool: ...
|
||||
def copy(self: Self) -> Self: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def __copy__(self: Self) -> Self: ...
|
||||
def __copy__(self: Self) -> Self: ...
|
||||
|
||||
# `UserDict.fromkeys` has the same semantics as `dict.fromkeys`, so should be kept in line with `dict.fromkeys`.
|
||||
# TODO: Much like `dict.fromkeys`, the true signature of `UserDict.fromkeys` is inexpressible in the current type system.
|
||||
@@ -142,9 +106,7 @@ class UserList(MutableSequence[_T]):
|
||||
def pop(self, i: int = ...) -> _T: ...
|
||||
def remove(self, item: _T) -> None: ...
|
||||
def copy(self: Self) -> Self: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def __copy__(self: Self) -> Self: ...
|
||||
|
||||
def __copy__(self: Self) -> Self: ...
|
||||
def count(self, item: _T) -> int: ...
|
||||
# All arguments are passed to `list.index` at runtime, so the signature should be kept in line with `list.index`.
|
||||
def index(self, item: _T, __start: SupportsIndex = ..., __stop: SupportsIndex = ...) -> int: ...
|
||||
@@ -208,9 +170,7 @@ class UserString(Sequence[UserString]):
|
||||
def isspace(self) -> bool: ...
|
||||
def istitle(self) -> bool: ...
|
||||
def isupper(self) -> bool: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def isascii(self) -> bool: ...
|
||||
|
||||
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: ...
|
||||
|
||||
+11
-46
@@ -1,10 +1,8 @@
|
||||
import sys
|
||||
from _typeshed import StrPath
|
||||
from py_compile import PycInvalidationMode
|
||||
from typing import Any, Protocol
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from py_compile import PycInvalidationMode
|
||||
|
||||
__all__ = ["compile_dir", "compile_file", "compile_path"]
|
||||
|
||||
class _SupportsSearch(Protocol):
|
||||
@@ -44,7 +42,7 @@ if sys.version_info >= (3, 9):
|
||||
hardlink_dupes: bool = ...,
|
||||
) -> int: ...
|
||||
|
||||
elif sys.version_info >= (3, 7):
|
||||
else:
|
||||
def compile_dir(
|
||||
dir: StrPath,
|
||||
maxlevels: int = ...,
|
||||
@@ -68,45 +66,12 @@ elif sys.version_info >= (3, 7):
|
||||
invalidation_mode: PycInvalidationMode | None = ...,
|
||||
) -> int: ...
|
||||
|
||||
else:
|
||||
def compile_dir(
|
||||
dir: StrPath,
|
||||
maxlevels: int = ...,
|
||||
ddir: StrPath | None = ...,
|
||||
force: bool = ...,
|
||||
rx: _SupportsSearch | None = ...,
|
||||
quiet: int = ...,
|
||||
legacy: bool = ...,
|
||||
optimize: int = ...,
|
||||
workers: int = ...,
|
||||
) -> int: ...
|
||||
def compile_file(
|
||||
fullname: StrPath,
|
||||
ddir: StrPath | None = ...,
|
||||
force: bool = ...,
|
||||
rx: _SupportsSearch | None = ...,
|
||||
quiet: int = ...,
|
||||
legacy: bool = ...,
|
||||
optimize: int = ...,
|
||||
) -> int: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def compile_path(
|
||||
skip_curdir: bool = ...,
|
||||
maxlevels: int = ...,
|
||||
force: bool = ...,
|
||||
quiet: int = ...,
|
||||
legacy: bool = ...,
|
||||
optimize: int = ...,
|
||||
invalidation_mode: PycInvalidationMode | None = ...,
|
||||
) -> int: ...
|
||||
|
||||
else:
|
||||
def compile_path(
|
||||
skip_curdir: bool = ...,
|
||||
maxlevels: int = ...,
|
||||
force: bool = ...,
|
||||
quiet: int = ...,
|
||||
legacy: bool = ...,
|
||||
optimize: int = ...,
|
||||
) -> int: ...
|
||||
def compile_path(
|
||||
skip_curdir: bool = ...,
|
||||
maxlevels: int = ...,
|
||||
force: bool = ...,
|
||||
quiet: int = ...,
|
||||
legacy: bool = ...,
|
||||
optimize: int = ...,
|
||||
invalidation_mode: PycInvalidationMode | None = ...,
|
||||
) -> int: ...
|
||||
|
||||
@@ -1,25 +1,10 @@
|
||||
import sys
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ = (
|
||||
"FIRST_COMPLETED",
|
||||
"FIRST_EXCEPTION",
|
||||
"ALL_COMPLETED",
|
||||
"CancelledError",
|
||||
"TimeoutError",
|
||||
"BrokenExecutor",
|
||||
"Future",
|
||||
"Executor",
|
||||
"wait",
|
||||
"as_completed",
|
||||
"ProcessPoolExecutor",
|
||||
"ThreadPoolExecutor",
|
||||
)
|
||||
|
||||
from ._base import (
|
||||
ALL_COMPLETED as ALL_COMPLETED,
|
||||
FIRST_COMPLETED as FIRST_COMPLETED,
|
||||
FIRST_EXCEPTION as FIRST_EXCEPTION,
|
||||
BrokenExecutor as BrokenExecutor,
|
||||
CancelledError as CancelledError,
|
||||
Executor as Executor,
|
||||
Future as Future,
|
||||
@@ -32,5 +17,18 @@ from .thread import ThreadPoolExecutor as ThreadPoolExecutor
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from ._base import InvalidStateError as InvalidStateError
|
||||
if sys.version_info >= (3, 7):
|
||||
from ._base import BrokenExecutor as BrokenExecutor
|
||||
|
||||
__all__ = (
|
||||
"FIRST_COMPLETED",
|
||||
"FIRST_EXCEPTION",
|
||||
"ALL_COMPLETED",
|
||||
"CancelledError",
|
||||
"TimeoutError",
|
||||
"BrokenExecutor",
|
||||
"Future",
|
||||
"Executor",
|
||||
"wait",
|
||||
"as_completed",
|
||||
"ProcessPoolExecutor",
|
||||
"ThreadPoolExecutor",
|
||||
)
|
||||
|
||||
@@ -30,8 +30,7 @@ class TimeoutError(Error): ...
|
||||
if sys.version_info >= (3, 8):
|
||||
class InvalidStateError(Error): ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
class BrokenExecutor(RuntimeError): ...
|
||||
class BrokenExecutor(RuntimeError): ...
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_T_co = TypeVar("_T_co", covariant=True)
|
||||
|
||||
@@ -8,7 +8,7 @@ from types import TracebackType
|
||||
from typing import Any, Generic, TypeVar
|
||||
from weakref import ref
|
||||
|
||||
from ._base import Executor, Future
|
||||
from ._base import BrokenExecutor, Executor, Future
|
||||
|
||||
_threads_wakeups: MutableMapping[Any, Any]
|
||||
_global_shutdown: bool
|
||||
@@ -68,27 +68,26 @@ class _CallItem:
|
||||
kwargs: Mapping[str, Any]
|
||||
def __init__(self, work_id: int, fn: Callable[..., Any], args: Iterable[Any], kwargs: Mapping[str, Any]) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
class _SafeQueue(Queue[Future[Any]]):
|
||||
pending_work_items: dict[int, _WorkItem[Any]]
|
||||
shutdown_lock: Lock
|
||||
thread_wakeup: _ThreadWakeup
|
||||
if sys.version_info >= (3, 9):
|
||||
def __init__(
|
||||
self,
|
||||
max_size: int | None = ...,
|
||||
*,
|
||||
ctx: BaseContext,
|
||||
pending_work_items: dict[int, _WorkItem[Any]],
|
||||
shutdown_lock: Lock,
|
||||
thread_wakeup: _ThreadWakeup,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
self, max_size: int | None = ..., *, ctx: BaseContext, pending_work_items: dict[int, _WorkItem[Any]]
|
||||
) -> None: ...
|
||||
class _SafeQueue(Queue[Future[Any]]):
|
||||
pending_work_items: dict[int, _WorkItem[Any]]
|
||||
shutdown_lock: Lock
|
||||
thread_wakeup: _ThreadWakeup
|
||||
if sys.version_info >= (3, 9):
|
||||
def __init__(
|
||||
self,
|
||||
max_size: int | None = ...,
|
||||
*,
|
||||
ctx: BaseContext,
|
||||
pending_work_items: dict[int, _WorkItem[Any]],
|
||||
shutdown_lock: Lock,
|
||||
thread_wakeup: _ThreadWakeup,
|
||||
) -> None: ...
|
||||
else:
|
||||
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 _on_queue_feeder_error(self, e: Exception, obj: _CallItem) -> None: ...
|
||||
|
||||
def _get_chunks(*iterables: Any, chunksize: int) -> Generator[tuple[Any, ...], None, None]: ...
|
||||
def _process_chunk(fn: Callable[..., Any], chunk: tuple[Any, None, None]) -> Generator[Any, None, None]: ...
|
||||
@@ -116,7 +115,7 @@ if sys.version_info >= (3, 11):
|
||||
max_tasks: int | None = ...,
|
||||
) -> None: ...
|
||||
|
||||
elif sys.version_info >= (3, 7):
|
||||
else:
|
||||
def _process_worker(
|
||||
call_queue: Queue[_CallItem],
|
||||
result_queue: SimpleQueue[_ResultItem],
|
||||
@@ -124,9 +123,6 @@ elif sys.version_info >= (3, 7):
|
||||
initargs: tuple[Any, ...],
|
||||
) -> None: ...
|
||||
|
||||
else:
|
||||
def _process_worker(call_queue: Queue[_CallItem], result_queue: SimpleQueue[_ResultItem]) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
class _ExecutorManagerThread(Thread):
|
||||
thread_wakeup: _ThreadWakeup
|
||||
@@ -155,13 +151,7 @@ _system_limited: bool | None
|
||||
def _check_system_limits() -> None: ...
|
||||
def _chain_from_iterable_of_lists(iterable: Iterable[MutableSequence[Any]]) -> Any: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from ._base import BrokenExecutor
|
||||
|
||||
class BrokenProcessPool(BrokenExecutor): ...
|
||||
|
||||
else:
|
||||
class BrokenProcessPool(RuntimeError): ...
|
||||
class BrokenProcessPool(BrokenExecutor): ...
|
||||
|
||||
class ProcessPoolExecutor(Executor):
|
||||
_mp_context: BaseContext | None = ...
|
||||
@@ -189,7 +179,7 @@ class ProcessPoolExecutor(Executor):
|
||||
*,
|
||||
max_tasks_per_child: int | None = ...,
|
||||
) -> None: ...
|
||||
elif sys.version_info >= (3, 7):
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
max_workers: int | None = ...,
|
||||
@@ -197,8 +187,6 @@ class ProcessPoolExecutor(Executor):
|
||||
initializer: Callable[..., object] | None = ...,
|
||||
initargs: tuple[Any, ...] = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, max_workers: int | None = ...) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def _start_executor_manager_thread(self) -> None: ...
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ from threading import Lock, Semaphore, Thread
|
||||
from typing import Any, Generic, TypeVar
|
||||
from weakref import ref
|
||||
|
||||
from ._base import Executor, Future
|
||||
from ._base import BrokenExecutor, Executor, Future
|
||||
|
||||
_threads_queues: Mapping[Any, Any]
|
||||
_shutdown: bool
|
||||
@@ -28,21 +28,14 @@ class _WorkItem(Generic[_S]):
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def _worker(
|
||||
executor_reference: ref[Any],
|
||||
work_queue: queue.SimpleQueue[Any],
|
||||
initializer: Callable[..., object],
|
||||
initargs: tuple[Any, ...],
|
||||
) -> None: ...
|
||||
def _worker(
|
||||
executor_reference: ref[Any],
|
||||
work_queue: queue.SimpleQueue[Any],
|
||||
initializer: Callable[..., object],
|
||||
initargs: tuple[Any, ...],
|
||||
) -> None: ...
|
||||
|
||||
else:
|
||||
def _worker(executor_reference: ref[Any], work_queue: queue.Queue[Any]) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from ._base import BrokenExecutor
|
||||
|
||||
class BrokenThreadPool(BrokenExecutor): ...
|
||||
class BrokenThreadPool(BrokenExecutor): ...
|
||||
|
||||
class ThreadPoolExecutor(Executor):
|
||||
_max_workers: int
|
||||
@@ -54,21 +47,13 @@ class ThreadPoolExecutor(Executor):
|
||||
_thread_name_prefix: str | None = ...
|
||||
_initializer: Callable[..., None] | None = ...
|
||||
_initargs: tuple[Any, ...] = ...
|
||||
if sys.version_info >= (3, 7):
|
||||
_work_queue: queue.SimpleQueue[_WorkItem[Any]]
|
||||
else:
|
||||
_work_queue: queue.Queue[_WorkItem[Any]]
|
||||
if sys.version_info >= (3, 7):
|
||||
def __init__(
|
||||
self,
|
||||
max_workers: int | None = ...,
|
||||
thread_name_prefix: str = ...,
|
||||
initializer: Callable[..., object] | None = ...,
|
||||
initargs: tuple[Any, ...] = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, max_workers: int | None = ..., thread_name_prefix: str = ...) -> None: ...
|
||||
|
||||
_work_queue: queue.SimpleQueue[_WorkItem[Any]]
|
||||
def __init__(
|
||||
self,
|
||||
max_workers: int | None = ...,
|
||||
thread_name_prefix: str = ...,
|
||||
initializer: Callable[..., object] | None = ...,
|
||||
initargs: tuple[Any, ...] = ...,
|
||||
) -> None: ...
|
||||
def _adjust_thread_count(self) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def _initializer_failed(self) -> None: ...
|
||||
def _initializer_failed(self) -> None: ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from _typeshed import StrOrBytesPath, StrPath, SupportsWrite
|
||||
from _typeshed import StrOrBytesPath, SupportsWrite
|
||||
from collections.abc import Callable, ItemsView, Iterable, Iterator, Mapping, MutableMapping, Sequence
|
||||
from typing import Any, ClassVar, Pattern, TypeVar, overload
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
@@ -34,11 +34,6 @@ _ConverterCallback: TypeAlias = Callable[[str], Any]
|
||||
_ConvertersMap: TypeAlias = dict[str, _ConverterCallback]
|
||||
_T = TypeVar("_T")
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
_Path: TypeAlias = StrOrBytesPath
|
||||
else:
|
||||
_Path: TypeAlias = StrPath
|
||||
|
||||
DEFAULTSECT: Literal["DEFAULT"]
|
||||
MAX_INTERPOLATION_DEPTH: Literal[10]
|
||||
|
||||
@@ -110,7 +105,7 @@ class RawConfigParser(_Parser):
|
||||
def has_section(self, section: str) -> bool: ...
|
||||
def options(self, section: str) -> list[str]: ...
|
||||
def has_option(self, section: str, option: str) -> bool: ...
|
||||
def read(self, filenames: _Path | Iterable[_Path], encoding: str | None = ...) -> list[str]: ...
|
||||
def read(self, filenames: StrOrBytesPath | Iterable[StrOrBytesPath], encoding: str | None = ...) -> list[str]: ...
|
||||
def read_file(self, f: Iterable[str], source: str | None = ...) -> None: ...
|
||||
def read_string(self, string: str, source: str = ...) -> None: ...
|
||||
def read_dict(self, dictionary: Mapping[str, Mapping[str, Any]], source: str = ...) -> None: ...
|
||||
|
||||
+30
-35
@@ -2,7 +2,7 @@ import sys
|
||||
from _typeshed import Self, StrOrBytesPath
|
||||
from collections.abc import AsyncGenerator, AsyncIterator, Awaitable, Callable, Generator, Iterator
|
||||
from types import TracebackType
|
||||
from typing import IO, Any, ContextManager, Generic, Protocol, TypeVar, overload # noqa: Y027
|
||||
from typing import IO, Any, AsyncContextManager, ContextManager, Generic, Protocol, TypeVar, overload # noqa: Y022,Y027
|
||||
from typing_extensions import ParamSpec, TypeAlias
|
||||
|
||||
__all__ = [
|
||||
@@ -14,23 +14,18 @@ __all__ = [
|
||||
"redirect_stdout",
|
||||
"redirect_stderr",
|
||||
"suppress",
|
||||
"AbstractAsyncContextManager",
|
||||
"AsyncExitStack",
|
||||
"asynccontextmanager",
|
||||
"nullcontext",
|
||||
]
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ += ["AbstractAsyncContextManager", "AsyncExitStack", "asynccontextmanager", "nullcontext"]
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
__all__ += ["aclosing"]
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
__all__ += ["chdir"]
|
||||
|
||||
AbstractContextManager = ContextManager
|
||||
if sys.version_info >= (3, 7):
|
||||
from typing import AsyncContextManager # noqa: Y022
|
||||
|
||||
AbstractAsyncContextManager = AsyncContextManager
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_T_co = TypeVar("_T_co", covariant=True)
|
||||
_T_io = TypeVar("_T_io", bound=IO[str] | None)
|
||||
@@ -40,12 +35,14 @@ _P = ParamSpec("_P")
|
||||
_ExitFunc: TypeAlias = Callable[[type[BaseException] | None, BaseException | None, TracebackType | None], bool | None]
|
||||
_CM_EF = TypeVar("_CM_EF", bound=AbstractContextManager[Any] | _ExitFunc)
|
||||
|
||||
AbstractContextManager = ContextManager
|
||||
AbstractAsyncContextManager = AsyncContextManager
|
||||
|
||||
class ContextDecorator:
|
||||
def __call__(self, func: _F) -> _F: ...
|
||||
|
||||
class _GeneratorContextManager(AbstractContextManager[_T_co], ContextDecorator, Generic[_T_co]):
|
||||
# In Python <= 3.6, __init__ and all instance attributes are defined directly on this class.
|
||||
# In Python >= 3.7, __init__ and all instance attributes are inherited from _GeneratorContextManagerBase
|
||||
# __init__ and all instance attributes are actually inherited from _GeneratorContextManagerBase
|
||||
# _GeneratorContextManagerBase is more trouble than it's worth to include in the stub; see #6676
|
||||
def __init__(self, func: Callable[..., Iterator[_T_co]], args: tuple[Any, ...], kwds: dict[str, Any]) -> None: ...
|
||||
gen: Generator[_T_co, Any, Any]
|
||||
@@ -76,7 +73,7 @@ if sys.version_info >= (3, 10):
|
||||
self, typ: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
|
||||
) -> bool | None: ...
|
||||
|
||||
elif sys.version_info >= (3, 7):
|
||||
else:
|
||||
class _AsyncGeneratorContextManager(AbstractAsyncContextManager[_T_co], Generic[_T_co]):
|
||||
def __init__(self, func: Callable[..., AsyncIterator[_T_co]], args: tuple[Any, ...], kwds: dict[str, Any]) -> None: ...
|
||||
gen: AsyncGenerator[_T_co, Any]
|
||||
@@ -87,8 +84,7 @@ elif sys.version_info >= (3, 7):
|
||||
self, typ: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
|
||||
) -> bool | None: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def asynccontextmanager(func: Callable[_P, AsyncIterator[_T_co]]) -> Callable[_P, _AsyncGeneratorContextManager[_T_co]]: ...
|
||||
def asynccontextmanager(func: Callable[_P, AsyncIterator[_T_co]]) -> Callable[_P, _AsyncGeneratorContextManager[_T_co]]: ...
|
||||
|
||||
class _SupportsClose(Protocol):
|
||||
def close(self) -> object: ...
|
||||
@@ -135,26 +131,25 @@ class ExitStack:
|
||||
self, __exc_type: type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None
|
||||
) -> bool: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
_ExitCoroFunc: TypeAlias = Callable[[type[BaseException] | None, BaseException | None, TracebackType | None], Awaitable[bool]]
|
||||
_ACM_EF = TypeVar("_ACM_EF", bound=AbstractAsyncContextManager[Any] | _ExitCoroFunc)
|
||||
_ExitCoroFunc: TypeAlias = Callable[[type[BaseException] | None, BaseException | None, TracebackType | None], Awaitable[bool]]
|
||||
_ACM_EF = TypeVar("_ACM_EF", bound=AbstractAsyncContextManager[Any] | _ExitCoroFunc)
|
||||
|
||||
class AsyncExitStack:
|
||||
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: ...
|
||||
def push_async_exit(self, exit: _ACM_EF) -> _ACM_EF: ...
|
||||
def callback(self, __callback: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]: ...
|
||||
def push_async_callback(
|
||||
self, __callback: Callable[_P, Awaitable[_T]], *args: _P.args, **kwds: _P.kwargs
|
||||
) -> Callable[_P, Awaitable[_T]]: ...
|
||||
def pop_all(self: Self) -> Self: ...
|
||||
async def aclose(self) -> None: ...
|
||||
async def __aenter__(self: Self) -> Self: ...
|
||||
async def __aexit__(
|
||||
self, __exc_type: type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None
|
||||
) -> bool: ...
|
||||
class AsyncExitStack:
|
||||
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: ...
|
||||
def push_async_exit(self, exit: _ACM_EF) -> _ACM_EF: ...
|
||||
def callback(self, __callback: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]: ...
|
||||
def push_async_callback(
|
||||
self, __callback: Callable[_P, Awaitable[_T]], *args: _P.args, **kwds: _P.kwargs
|
||||
) -> Callable[_P, Awaitable[_T]]: ...
|
||||
def pop_all(self: Self) -> Self: ...
|
||||
async def aclose(self) -> None: ...
|
||||
async def __aenter__(self: Self) -> Self: ...
|
||||
async def __aexit__(
|
||||
self, __exc_type: type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None
|
||||
) -> bool: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
class nullcontext(AbstractContextManager[_T], AbstractAsyncContextManager[_T]):
|
||||
@@ -168,7 +163,7 @@ if sys.version_info >= (3, 10):
|
||||
async def __aenter__(self) -> _T: ...
|
||||
async def __aexit__(self, *exctype: object) -> None: ...
|
||||
|
||||
elif sys.version_info >= (3, 7):
|
||||
else:
|
||||
class nullcontext(AbstractContextManager[_T]):
|
||||
enter_result: _T
|
||||
@overload
|
||||
|
||||
+2
-9
@@ -6,14 +6,7 @@ if sys.platform != "win32":
|
||||
METHOD_MD5: _Method
|
||||
METHOD_SHA256: _Method
|
||||
METHOD_SHA512: _Method
|
||||
if sys.version_info >= (3, 7):
|
||||
METHOD_BLOWFISH: _Method
|
||||
|
||||
METHOD_BLOWFISH: _Method
|
||||
methods: list[_Method]
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def mksalt(method: _Method | None = ..., *, rounds: int | None = ...) -> str: ...
|
||||
else:
|
||||
def mksalt(method: _Method | None = ...) -> str: ...
|
||||
|
||||
def mksalt(method: _Method | None = ..., *, rounds: int | None = ...) -> str: ...
|
||||
def crypt(word: str, salt: str | _Method | None = ...) -> str: ...
|
||||
|
||||
+6
-11
@@ -51,9 +51,8 @@ class date:
|
||||
def today(cls: type[Self]) -> Self: ...
|
||||
@classmethod
|
||||
def fromordinal(cls: type[Self], __n: int) -> Self: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
@classmethod
|
||||
def fromisoformat(cls: type[Self], __date_string: str) -> Self: ...
|
||||
@classmethod
|
||||
def fromisoformat(cls: type[Self], __date_string: str) -> Self: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
@classmethod
|
||||
def fromisocalendar(cls: type[Self], year: int, week: int, day: int) -> Self: ...
|
||||
@@ -135,10 +134,8 @@ class time:
|
||||
def __gt__(self, __other: time) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def isoformat(self, timespec: str = ...) -> str: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
@classmethod
|
||||
def fromisoformat(cls: type[Self], __time_string: str) -> Self: ...
|
||||
|
||||
@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: ...
|
||||
@@ -256,10 +253,8 @@ class datetime(date):
|
||||
def utcnow(cls: type[Self]) -> Self: ...
|
||||
@classmethod
|
||||
def combine(cls, date: _Date, time: _Time, tzinfo: _TzInfo | None = ...) -> datetime: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
@classmethod
|
||||
def fromisoformat(cls: type[Self], __date_string: str) -> Self: ...
|
||||
|
||||
@classmethod
|
||||
def fromisoformat(cls: type[Self], __date_string: str) -> Self: ...
|
||||
def timestamp(self) -> float: ...
|
||||
def utctimetuple(self) -> struct_time: ...
|
||||
def date(self) -> _Date: ...
|
||||
|
||||
+1
-4
@@ -114,11 +114,8 @@ if sys.version_info >= (3, 11):
|
||||
adaptive: bool = ...,
|
||||
) -> None: ...
|
||||
|
||||
elif sys.version_info >= (3, 7):
|
||||
def dis(x: _HaveCodeOrStringType | None = ..., *, file: IO[str] | None = ..., depth: int | None = ...) -> None: ...
|
||||
|
||||
else:
|
||||
def dis(x: _HaveCodeOrStringType | None = ..., *, file: IO[str] | None = ...) -> None: ...
|
||||
def dis(x: _HaveCodeOrStringType | None = ..., *, file: IO[str] | None = ..., depth: int | None = ...) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
def disassemble(
|
||||
|
||||
@@ -20,8 +20,7 @@ EXTENDED_ATTRIBUTE_ENDS: Final[set[str]]
|
||||
|
||||
def quote_string(value: Any) -> str: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
rfc2047_matcher: Pattern[str]
|
||||
rfc2047_matcher: Pattern[str]
|
||||
|
||||
class TokenList(list[TokenList | Terminal]):
|
||||
token_type: str | None
|
||||
|
||||
+1
-2
@@ -161,8 +161,7 @@ class Enum(metaclass=EnumMeta):
|
||||
def value(self) -> Any: ...
|
||||
_name_: str
|
||||
_value_: Any
|
||||
if sys.version_info >= (3, 7):
|
||||
_ignore_: str | list[str]
|
||||
_ignore_: str | list[str]
|
||||
_order_: str
|
||||
__order__: str
|
||||
@classmethod
|
||||
|
||||
+3
-5
@@ -26,11 +26,9 @@ if sys.version_info >= (3, 8):
|
||||
else:
|
||||
def get_objects() -> list[Any]: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def freeze() -> None: ...
|
||||
def unfreeze() -> None: ...
|
||||
def get_freeze_count() -> int: ...
|
||||
|
||||
def freeze() -> None: ...
|
||||
def unfreeze() -> None: ...
|
||||
def get_freeze_count() -> int: ...
|
||||
def get_referents(*objs: Any) -> list[Any]: ...
|
||||
def get_referrers(*objs: Any) -> list[Any]: ...
|
||||
def get_stats() -> list[dict[str, Any]]: ...
|
||||
|
||||
+1
-3
@@ -40,6 +40,4 @@ class HMAC:
|
||||
def compare_digest(__a: ReadableBuffer, __b: ReadableBuffer) -> bool: ...
|
||||
@overload
|
||||
def compare_digest(__a: AnyStr, __b: AnyStr) -> bool: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def digest(key: bytes, msg: ReadableBuffer, digest: _DigestMod) -> bytes: ...
|
||||
def digest(key: bytes, msg: ReadableBuffer, digest: _DigestMod) -> bytes: ...
|
||||
|
||||
@@ -72,8 +72,7 @@ class HTTPStatus(IntEnum):
|
||||
LOOP_DETECTED: int
|
||||
NOT_EXTENDED: int
|
||||
NETWORK_AUTHENTICATION_REQUIRED: int
|
||||
if sys.version_info >= (3, 7):
|
||||
MISDIRECTED_REQUEST: int
|
||||
MISDIRECTED_REQUEST: int
|
||||
if sys.version_info >= (3, 8):
|
||||
UNAVAILABLE_FOR_LEGAL_REASONS: int
|
||||
if sys.version_info >= (3, 9):
|
||||
|
||||
+29
-55
@@ -1,7 +1,6 @@
|
||||
import email.message
|
||||
import io
|
||||
import ssl
|
||||
import sys
|
||||
import types
|
||||
from _typeshed import Self, WriteableBuffer
|
||||
from collections.abc import Callable, Iterable, Iterator, Mapping
|
||||
@@ -141,19 +140,14 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO):
|
||||
# This is an API stub only for the class below, not a class itself.
|
||||
# urllib.request uses it for a parameter.
|
||||
class _HTTPConnectionProtocol(Protocol):
|
||||
if sys.version_info >= (3, 7):
|
||||
def __call__(
|
||||
self,
|
||||
host: str,
|
||||
port: int | None = ...,
|
||||
timeout: float = ...,
|
||||
source_address: tuple[str, int] | None = ...,
|
||||
blocksize: int = ...,
|
||||
) -> HTTPConnection: ...
|
||||
else:
|
||||
def __call__(
|
||||
self, host: str, port: int | None = ..., timeout: float = ..., source_address: tuple[str, int] | None = ...
|
||||
) -> HTTPConnection: ...
|
||||
def __call__(
|
||||
self,
|
||||
host: str,
|
||||
port: int | None = ...,
|
||||
timeout: float = ...,
|
||||
source_address: tuple[str, int] | None = ...,
|
||||
blocksize: int = ...,
|
||||
) -> HTTPConnection: ...
|
||||
|
||||
class HTTPConnection:
|
||||
auto_open: int # undocumented
|
||||
@@ -164,20 +158,14 @@ class HTTPConnection:
|
||||
host: str
|
||||
port: int
|
||||
sock: Any
|
||||
if sys.version_info >= (3, 7):
|
||||
def __init__(
|
||||
self,
|
||||
host: str,
|
||||
port: int | None = ...,
|
||||
timeout: float | None = ...,
|
||||
source_address: tuple[str, int] | None = ...,
|
||||
blocksize: int = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
self, host: str, port: int | None = ..., timeout: float | None = ..., source_address: tuple[str, int] | None = ...
|
||||
) -> None: ...
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
host: str,
|
||||
port: int | None = ...,
|
||||
timeout: float | None = ...,
|
||||
source_address: tuple[str, int] | None = ...,
|
||||
blocksize: int = ...,
|
||||
) -> None: ...
|
||||
def request(
|
||||
self, method: str, url: str, body: _DataType | None = ..., headers: Mapping[str, str] = ..., *, encode_chunked: bool = ...
|
||||
) -> None: ...
|
||||
@@ -192,33 +180,19 @@ class HTTPConnection:
|
||||
def send(self, data: _DataType) -> None: ...
|
||||
|
||||
class HTTPSConnection(HTTPConnection):
|
||||
if sys.version_info >= (3, 7):
|
||||
def __init__(
|
||||
self,
|
||||
host: str,
|
||||
port: int | None = ...,
|
||||
key_file: str | None = ...,
|
||||
cert_file: str | None = ...,
|
||||
timeout: float | None = ...,
|
||||
source_address: tuple[str, int] | None = ...,
|
||||
*,
|
||||
context: ssl.SSLContext | None = ...,
|
||||
check_hostname: bool | None = ...,
|
||||
blocksize: int = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
host: str,
|
||||
port: int | None = ...,
|
||||
key_file: str | None = ...,
|
||||
cert_file: str | None = ...,
|
||||
timeout: float | None = ...,
|
||||
source_address: tuple[str, int] | None = ...,
|
||||
*,
|
||||
context: ssl.SSLContext | None = ...,
|
||||
check_hostname: bool | None = ...,
|
||||
) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
host: str,
|
||||
port: int | None = ...,
|
||||
key_file: str | None = ...,
|
||||
cert_file: str | None = ...,
|
||||
timeout: float | None = ...,
|
||||
source_address: tuple[str, int] | None = ...,
|
||||
*,
|
||||
context: ssl.SSLContext | None = ...,
|
||||
check_hostname: bool | None = ...,
|
||||
blocksize: int = ...,
|
||||
) -> None: ...
|
||||
|
||||
class HTTPException(Exception): ...
|
||||
|
||||
|
||||
@@ -30,11 +30,7 @@ class Morsel(dict[str, Any], Generic[_T]):
|
||||
@property
|
||||
def key(self) -> str: ...
|
||||
def __init__(self) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
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 set(self, key: str, val: str, coded_val: _T) -> 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]
|
||||
|
||||
+6
-15
@@ -1,23 +1,18 @@
|
||||
import email.message
|
||||
import io
|
||||
import socketserver
|
||||
import sys
|
||||
from _typeshed import StrPath, SupportsRead, SupportsWrite
|
||||
from collections.abc import Mapping, Sequence
|
||||
from typing import Any, AnyStr, BinaryIO, ClassVar
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ = ["HTTPServer", "ThreadingHTTPServer", "BaseHTTPRequestHandler", "SimpleHTTPRequestHandler", "CGIHTTPRequestHandler"]
|
||||
else:
|
||||
__all__ = ["HTTPServer", "BaseHTTPRequestHandler", "SimpleHTTPRequestHandler", "CGIHTTPRequestHandler"]
|
||||
__all__ = ["HTTPServer", "ThreadingHTTPServer", "BaseHTTPRequestHandler", "SimpleHTTPRequestHandler", "CGIHTTPRequestHandler"]
|
||||
|
||||
class HTTPServer(socketserver.TCPServer):
|
||||
server_name: str
|
||||
server_port: int
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
class ThreadingHTTPServer(socketserver.ThreadingMixIn, HTTPServer):
|
||||
daemon_threads: bool # undocumented
|
||||
class ThreadingHTTPServer(socketserver.ThreadingMixIn, HTTPServer):
|
||||
daemon_threads: bool # undocumented
|
||||
|
||||
class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
|
||||
client_address: tuple[str, int]
|
||||
@@ -60,13 +55,9 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
|
||||
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
|
||||
server_version: str
|
||||
extensions_map: dict[str, str]
|
||||
if sys.version_info >= (3, 7):
|
||||
def __init__(
|
||||
self, request: bytes, client_address: tuple[str, int], server: socketserver.BaseServer, directory: str | None = ...
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, request: bytes, client_address: tuple[str, int], server: socketserver.BaseServer) -> None: ...
|
||||
|
||||
def __init__(
|
||||
self, request: bytes, client_address: tuple[str, int], server: socketserver.BaseServer, directory: str | None = ...
|
||||
) -> None: ...
|
||||
def do_GET(self) -> None: ...
|
||||
def do_HEAD(self) -> None: ...
|
||||
def send_head(self) -> io.BytesIO | BinaryIO | None: ... # undocumented
|
||||
|
||||
+11
-12
@@ -96,21 +96,20 @@ class FileLoader(ResourceLoader, ExecutionLoader, metaclass=ABCMeta):
|
||||
def get_filename(self, name: str | None = ...) -> _Path: ...
|
||||
def load_module(self, name: str | None = ...) -> types.ModuleType: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
class ResourceReader(metaclass=ABCMeta):
|
||||
class ResourceReader(metaclass=ABCMeta):
|
||||
@abstractmethod
|
||||
def open_resource(self, resource: StrOrBytesPath) -> IO[bytes]: ...
|
||||
@abstractmethod
|
||||
def resource_path(self, resource: StrOrBytesPath) -> str: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
@abstractmethod
|
||||
def open_resource(self, resource: StrOrBytesPath) -> IO[bytes]: ...
|
||||
def is_resource(self, path: str) -> bool: ...
|
||||
else:
|
||||
@abstractmethod
|
||||
def resource_path(self, resource: StrOrBytesPath) -> str: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
@abstractmethod
|
||||
def is_resource(self, path: str) -> bool: ...
|
||||
else:
|
||||
@abstractmethod
|
||||
def is_resource(self, name: str) -> bool: ...
|
||||
def is_resource(self, name: str) -> bool: ...
|
||||
|
||||
@abstractmethod
|
||||
def contents(self) -> Iterator[str]: ...
|
||||
@abstractmethod
|
||||
def contents(self) -> Iterator[str]: ...
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
@runtime_checkable
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import importlib.abc
|
||||
import importlib.machinery
|
||||
import sys
|
||||
import types
|
||||
from _typeshed import StrOrBytesPath
|
||||
from collections.abc import Callable
|
||||
@@ -39,5 +38,4 @@ class LazyLoader(importlib.abc.Loader):
|
||||
def create_module(self, spec: importlib.machinery.ModuleSpec) -> types.ModuleType | None: ...
|
||||
def exec_module(self, module: types.ModuleType) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def source_hash(source_bytes: bytes) -> int: ...
|
||||
def source_hash(source_bytes: bytes) -> int: ...
|
||||
|
||||
+20
-35
@@ -9,6 +9,7 @@ from types import (
|
||||
AsyncGeneratorType,
|
||||
BuiltinFunctionType,
|
||||
BuiltinMethodType,
|
||||
ClassMethodDescriptorType,
|
||||
CodeType,
|
||||
CoroutineType,
|
||||
FrameType,
|
||||
@@ -16,23 +17,16 @@ from types import (
|
||||
GeneratorType,
|
||||
GetSetDescriptorType,
|
||||
LambdaType,
|
||||
MemberDescriptorType,
|
||||
MethodDescriptorType,
|
||||
MethodType,
|
||||
MethodWrapperType,
|
||||
ModuleType,
|
||||
TracebackType,
|
||||
WrapperDescriptorType,
|
||||
)
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from types import (
|
||||
ClassMethodDescriptorType,
|
||||
WrapperDescriptorType,
|
||||
MemberDescriptorType,
|
||||
MethodDescriptorType,
|
||||
MethodWrapperType,
|
||||
)
|
||||
|
||||
from typing import Any, ClassVar, NamedTuple, Protocol, TypeVar, Union
|
||||
from typing_extensions import Literal, ParamSpec, TypeGuard
|
||||
from typing_extensions import Literal, ParamSpec, TypeAlias, TypeGuard
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
__all__ = [
|
||||
@@ -214,29 +208,20 @@ def isbuiltin(object: object) -> TypeGuard[BuiltinFunctionType]: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def ismethodwrapper(object: object) -> TypeGuard[MethodWrapperType]: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def isroutine(
|
||||
object: object,
|
||||
) -> TypeGuard[
|
||||
FunctionType
|
||||
| LambdaType
|
||||
| MethodType
|
||||
| BuiltinFunctionType
|
||||
| BuiltinMethodType
|
||||
| WrapperDescriptorType
|
||||
| MethodDescriptorType
|
||||
| ClassMethodDescriptorType
|
||||
]: ...
|
||||
def ismethoddescriptor(object: object) -> TypeGuard[MethodDescriptorType]: ...
|
||||
def ismemberdescriptor(object: object) -> TypeGuard[MemberDescriptorType]: ...
|
||||
|
||||
else:
|
||||
def isroutine(
|
||||
object: object,
|
||||
) -> TypeGuard[FunctionType | LambdaType | MethodType | BuiltinFunctionType | BuiltinMethodType]: ...
|
||||
def ismethoddescriptor(object: object) -> bool: ...
|
||||
def ismemberdescriptor(object: object) -> bool: ...
|
||||
|
||||
def isroutine(
|
||||
object: object,
|
||||
) -> TypeGuard[
|
||||
FunctionType
|
||||
| LambdaType
|
||||
| MethodType
|
||||
| BuiltinFunctionType
|
||||
| BuiltinMethodType
|
||||
| WrapperDescriptorType
|
||||
| MethodDescriptorType
|
||||
| ClassMethodDescriptorType
|
||||
]: ...
|
||||
def ismethoddescriptor(object: object) -> TypeGuard[MethodDescriptorType]: ...
|
||||
def ismemberdescriptor(object: object) -> TypeGuard[MemberDescriptorType]: ...
|
||||
def isabstract(object: object) -> bool: ...
|
||||
def isgetsetdescriptor(object: object) -> TypeGuard[GetSetDescriptorType]: ...
|
||||
def isdatadescriptor(object: object) -> TypeGuard[_SupportsSet[Any, Any] | _SupportsDelete[Any]]: ...
|
||||
|
||||
+14
-24
@@ -110,19 +110,13 @@ class BytesIO(BufferedIOBase, BinaryIO):
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def getvalue(self) -> bytes: ...
|
||||
def getbuffer(self) -> memoryview: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def read1(self, __size: int | None = ...) -> bytes: ...
|
||||
else:
|
||||
def read1(self, __size: int | None) -> bytes: ... # type: ignore[override]
|
||||
def read1(self, __size: int | None = ...) -> bytes: ...
|
||||
|
||||
class BufferedReader(BufferedIOBase, BinaryIO):
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ...
|
||||
def peek(self, __size: int = ...) -> bytes: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def read1(self, __size: int = ...) -> bytes: ...
|
||||
else:
|
||||
def read1(self, __size: int) -> bytes: ... # type: ignore[override]
|
||||
def read1(self, __size: int = ...) -> bytes: ...
|
||||
|
||||
class BufferedWriter(BufferedIOBase, BinaryIO):
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
@@ -133,10 +127,7 @@ class BufferedRandom(BufferedReader, BufferedWriter):
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ...
|
||||
def seek(self, __target: int, __whence: int = ...) -> int: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def read1(self, __size: int = ...) -> bytes: ...
|
||||
else:
|
||||
def read1(self, __size: int) -> bytes: ... # type: ignore[override]
|
||||
def read1(self, __size: int = ...) -> bytes: ...
|
||||
|
||||
class BufferedRWPair(BufferedIOBase):
|
||||
def __init__(self, reader: RawIOBase, writer: RawIOBase, buffer_size: int = ...) -> None: ...
|
||||
@@ -172,18 +163,17 @@ class TextIOWrapper(TextIOBase, TextIO):
|
||||
def closed(self) -> bool: ...
|
||||
@property
|
||||
def line_buffering(self) -> bool: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
@property
|
||||
def write_through(self) -> bool: ...
|
||||
def reconfigure(
|
||||
self,
|
||||
*,
|
||||
encoding: str | None = ...,
|
||||
errors: str | None = ...,
|
||||
newline: str | None = ...,
|
||||
line_buffering: bool | None = ...,
|
||||
write_through: bool | None = ...,
|
||||
) -> None: ...
|
||||
@property
|
||||
def write_through(self) -> bool: ...
|
||||
def reconfigure(
|
||||
self,
|
||||
*,
|
||||
encoding: str | None = ...,
|
||||
errors: str | None = ...,
|
||||
newline: str | None = ...,
|
||||
line_buffering: bool | None = ...,
|
||||
write_through: bool | None = ...,
|
||||
) -> None: ...
|
||||
# These are inherited from TextIOBase, but must exist in the stub to satisfy mypy.
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __iter__(self) -> Iterator[str]: ... # type: ignore[override]
|
||||
|
||||
@@ -109,10 +109,8 @@ class _BaseNetwork(_IPAddressBase, Container[_A], Iterable[_A], Generic[_A]):
|
||||
def overlaps(self, other: _BaseNetwork[IPv4Address] | _BaseNetwork[IPv6Address]) -> bool: ...
|
||||
@property
|
||||
def prefixlen(self) -> int: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def subnet_of(self: Self, other: Self) -> bool: ...
|
||||
def supernet_of(self: Self, other: Self) -> bool: ...
|
||||
|
||||
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
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import sys
|
||||
|
||||
ENDMARKER: int
|
||||
NAME: int
|
||||
NUMBER: int
|
||||
@@ -59,8 +57,7 @@ ATEQUAL: int
|
||||
AWAIT: int
|
||||
ASYNC: int
|
||||
ERRORTOKEN: int
|
||||
if sys.version_info >= (3, 7):
|
||||
COLONEQUAL: int
|
||||
COLONEQUAL: int
|
||||
N_TOKENS: int
|
||||
NT_OFFSET: int
|
||||
tok_name: dict[int, str]
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import sys
|
||||
from collections.abc import Callable, Iterable, Iterator
|
||||
from lib2to3.pgen2.token import *
|
||||
from typing_extensions import TypeAlias
|
||||
@@ -72,11 +71,9 @@ __all__ = [
|
||||
"tokenize",
|
||||
"generate_tokens",
|
||||
"untokenize",
|
||||
"COLONEQUAL",
|
||||
]
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ += ["COLONEQUAL"]
|
||||
|
||||
_Coord: TypeAlias = tuple[int, int]
|
||||
_TokenEater: TypeAlias = Callable[[int, str, _Coord, _Coord, str], object]
|
||||
_TokenInfo: TypeAlias = tuple[int, str, _Coord, _Coord, str]
|
||||
|
||||
+1
-7
@@ -122,13 +122,7 @@ def resetlocale(category: int = ...) -> None: ...
|
||||
def strcoll(__os1: _str, __os2: _str) -> int: ...
|
||||
def strxfrm(__string: _str) -> _str: ...
|
||||
def format(percent: _str, value: float | Decimal, grouping: bool = ..., monetary: bool = ..., *additional: Any) -> _str: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def format_string(f: _str, val: Any, grouping: bool = ..., monetary: bool = ...) -> _str: ...
|
||||
|
||||
else:
|
||||
def format_string(f: _str, val: Any, grouping: bool = ...) -> _str: ...
|
||||
|
||||
def format_string(f: _str, val: Any, grouping: bool = ..., monetary: bool = ...) -> _str: ...
|
||||
def currency(val: float | Decimal, symbol: bool = ..., grouping: bool = ..., international: bool = ...) -> _str: ...
|
||||
def delocalize(string: _str) -> _str: ...
|
||||
def atof(string: _str, func: Callable[[_str], float] = ...) -> float: ...
|
||||
|
||||
@@ -708,12 +708,7 @@ else:
|
||||
|
||||
fatal = critical
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def disable(level: int = ...) -> None: ...
|
||||
|
||||
else:
|
||||
def disable(level: int) -> None: ...
|
||||
|
||||
def disable(level: int = ...) -> None: ...
|
||||
def addLevelName(level: int, levelName: str) -> None: ...
|
||||
def getLevelName(level: _Level) -> Any: ...
|
||||
|
||||
@@ -781,8 +776,7 @@ class StreamHandler(Handler, Generic[_StreamT]):
|
||||
def __init__(self: StreamHandler[TextIO], stream: None = ...) -> None: ...
|
||||
@overload
|
||||
def __init__(self: StreamHandler[_StreamT], stream: _StreamT) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def setStream(self, stream: _StreamT) -> _StreamT | None: ...
|
||||
def setStream(self, stream: _StreamT) -> _StreamT | None: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import sys
|
||||
from _typeshed import StrOrBytesPath, StrPath
|
||||
from _typeshed import StrOrBytesPath
|
||||
from collections.abc import Callable, Sequence
|
||||
from configparser import RawConfigParser
|
||||
from threading import Thread
|
||||
from typing import IO, Any, Pattern
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from . import _Level
|
||||
|
||||
@@ -13,11 +12,6 @@ if sys.version_info >= (3, 8):
|
||||
else:
|
||||
from typing_extensions import Literal, TypedDict
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
_Path: TypeAlias = StrOrBytesPath
|
||||
else:
|
||||
_Path: TypeAlias = StrPath
|
||||
|
||||
DEFAULT_LOGGING_CONFIG_PORT: int
|
||||
RESET_ERROR: int # undocumented
|
||||
IDENTIFIER: Pattern[str] # undocumented
|
||||
@@ -53,7 +47,7 @@ def dictConfig(config: _DictConfigArgs | dict[str, Any]) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
def fileConfig(
|
||||
fname: _Path | IO[str] | RawConfigParser,
|
||||
fname: StrOrBytesPath | IO[str] | RawConfigParser,
|
||||
defaults: dict[str, str] | None = ...,
|
||||
disable_existing_loggers: bool = ...,
|
||||
encoding: str | None = ...,
|
||||
@@ -61,7 +55,9 @@ if sys.version_info >= (3, 10):
|
||||
|
||||
else:
|
||||
def fileConfig(
|
||||
fname: _Path | IO[str] | RawConfigParser, defaults: dict[str, str] | None = ..., disable_existing_loggers: bool = ...
|
||||
fname: StrOrBytesPath | IO[str] | RawConfigParser,
|
||||
defaults: dict[str, str] | None = ...,
|
||||
disable_existing_loggers: bool = ...,
|
||||
) -> None: ...
|
||||
|
||||
def valid_ident(s: str) -> Literal[True]: ... # undocumented
|
||||
|
||||
@@ -5,14 +5,10 @@ import sys
|
||||
from _typeshed import StrPath
|
||||
from collections.abc import Callable
|
||||
from logging import FileHandler, Handler, LogRecord
|
||||
from queue import Queue, SimpleQueue
|
||||
from socket import SocketKind, socket
|
||||
from typing import Any, ClassVar, Pattern
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from queue import Queue, SimpleQueue
|
||||
else:
|
||||
from queue import Queue
|
||||
|
||||
DEFAULT_TCP_LOGGING_PORT: int
|
||||
DEFAULT_UDP_LOGGING_PORT: int
|
||||
DEFAULT_HTTP_LOGGING_PORT: int
|
||||
@@ -251,28 +247,16 @@ class HTTPHandler(Handler):
|
||||
def getConnection(self, host: str, secure: bool) -> http.client.HTTPConnection: ... # undocumented
|
||||
|
||||
class QueueHandler(Handler):
|
||||
if sys.version_info >= (3, 7):
|
||||
queue: SimpleQueue[Any] | Queue[Any] # undocumented
|
||||
def __init__(self, queue: SimpleQueue[Any] | Queue[Any]) -> None: ...
|
||||
else:
|
||||
queue: Queue[Any] # undocumented
|
||||
def __init__(self, queue: Queue[Any]) -> None: ...
|
||||
|
||||
queue: SimpleQueue[Any] | Queue[Any] # undocumented
|
||||
def __init__(self, queue: SimpleQueue[Any] | Queue[Any]) -> None: ...
|
||||
def prepare(self, record: LogRecord) -> Any: ...
|
||||
def enqueue(self, record: LogRecord) -> None: ...
|
||||
|
||||
class QueueListener:
|
||||
handlers: tuple[Handler, ...] # undocumented
|
||||
respect_handler_level: bool # undocumented
|
||||
if sys.version_info >= (3, 7):
|
||||
queue: SimpleQueue[Any] | Queue[Any] # undocumented
|
||||
def __init__(
|
||||
self, queue: SimpleQueue[Any] | Queue[Any], *handlers: Handler, respect_handler_level: bool = ...
|
||||
) -> None: ...
|
||||
else:
|
||||
queue: Queue[Any] # undocumented
|
||||
def __init__(self, queue: Queue[Any], *handlers: Handler, respect_handler_level: bool = ...) -> None: ...
|
||||
|
||||
queue: SimpleQueue[Any] | Queue[Any] # undocumented
|
||||
def __init__(self, queue: SimpleQueue[Any] | 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: ...
|
||||
|
||||
+1
-4
@@ -113,10 +113,7 @@ if sys.version_info >= (3, 8):
|
||||
def prod(__iterable: Iterable[_SupportsFloatOrIndex], *, start: _SupportsFloatOrIndex = ...) -> float: ...
|
||||
|
||||
def radians(__x: _SupportsFloatOrIndex) -> float: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def remainder(__x: _SupportsFloatOrIndex, __y: _SupportsFloatOrIndex) -> float: ...
|
||||
|
||||
def remainder(__x: _SupportsFloatOrIndex, __y: _SupportsFloatOrIndex) -> float: ...
|
||||
def sin(__x: _SupportsFloatOrIndex) -> float: ...
|
||||
def sinh(__x: _SupportsFloatOrIndex) -> float: ...
|
||||
def sqrt(__x: _SupportsFloatOrIndex) -> float: ...
|
||||
|
||||
@@ -14,8 +14,6 @@ if sys.platform == "win32":
|
||||
)
|
||||
|
||||
AMD64: bool
|
||||
if sys.version_info < (3, 7):
|
||||
Itanium: bool
|
||||
Win64: bool
|
||||
|
||||
datasizemask: Literal[0x00FF]
|
||||
|
||||
@@ -84,8 +84,6 @@ class DictProxy(BaseProxy, MutableMapping[_KT, _VT]):
|
||||
def keys(self) -> list[_KT]: ... # type: ignore[override]
|
||||
def values(self) -> list[tuple[_KT, _VT]]: ... # type: ignore[override]
|
||||
def items(self) -> list[_VT]: ... # type: ignore[override]
|
||||
if sys.version_info < (3, 7):
|
||||
def has_key(self, k: _KT) -> bool: ...
|
||||
|
||||
class BaseListProxy(BaseProxy, MutableSequence[_T]):
|
||||
__builtins__: ClassVar[dict[str, Any]]
|
||||
|
||||
@@ -25,10 +25,8 @@ class BaseProcess:
|
||||
def run(self) -> None: ...
|
||||
def start(self) -> None: ...
|
||||
def terminate(self) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def kill(self) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
def kill(self) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def join(self, timeout: float | None = ...) -> None: ...
|
||||
def is_alive(self) -> bool: ...
|
||||
@property
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import sys
|
||||
import threading
|
||||
from collections.abc import Callable
|
||||
from contextlib import AbstractContextManager
|
||||
@@ -20,11 +19,7 @@ class BoundedSemaphore(Semaphore):
|
||||
|
||||
class Condition(AbstractContextManager[bool]):
|
||||
def __init__(self, lock: _LockLike | None = ..., *, ctx: BaseContext) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def notify(self, n: int = ...) -> None: ...
|
||||
else:
|
||||
def notify(self) -> None: ...
|
||||
|
||||
def notify(self, n: int = ...) -> None: ...
|
||||
def notify_all(self) -> None: ...
|
||||
def wait(self, timeout: float | None = ...) -> bool: ...
|
||||
def wait_for(self, predicate: Callable[[], bool], timeout: float | None = ...) -> bool: ...
|
||||
|
||||
@@ -86,11 +86,6 @@ __all__ = [
|
||||
"commonpath",
|
||||
]
|
||||
|
||||
if sys.version_info < (3, 7):
|
||||
__all__ += ["splitunc"]
|
||||
|
||||
def splitunc(p: AnyStr) -> tuple[AnyStr, AnyStr]: ... # deprecated
|
||||
|
||||
altsep: LiteralString
|
||||
|
||||
# First parameter is not actually pos-only,
|
||||
|
||||
+26
-63
@@ -388,13 +388,8 @@ class DirEntry(Generic[AnyStr]):
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
_StatVfsTuple: TypeAlias = tuple[int, int, int, int, int, int, int, int, int, int, int]
|
||||
else:
|
||||
_StatVfsTuple: TypeAlias = tuple[int, int, int, int, int, int, int, int, int, int]
|
||||
|
||||
@final
|
||||
class statvfs_result(structseq[int], _StatVfsTuple):
|
||||
class statvfs_result(structseq[int], tuple[int, int, int, int, int, int, int, int, int, int, int]):
|
||||
if sys.version_info >= (3, 10):
|
||||
__match_args__: Final = (
|
||||
"f_bsize",
|
||||
@@ -428,9 +423,8 @@ class statvfs_result(structseq[int], _StatVfsTuple):
|
||||
def f_flag(self) -> int: ...
|
||||
@property
|
||||
def f_namemax(self) -> int: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
@property
|
||||
def f_fsid(self) -> int: ...
|
||||
@property
|
||||
def f_fsid(self) -> int: ...
|
||||
|
||||
# ----- os function stubs -----
|
||||
def fsencode(filename: StrOrBytesPath) -> bytes: ...
|
||||
@@ -595,13 +589,7 @@ def close(fd: int) -> None: ...
|
||||
def closerange(__fd_low: int, __fd_high: int) -> None: ...
|
||||
def device_encoding(fd: int) -> str | None: ...
|
||||
def dup(__fd: int) -> int: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def dup2(fd: int, fd2: int, inheritable: bool = ...) -> int: ...
|
||||
|
||||
else:
|
||||
def dup2(fd: int, fd2: int, inheritable: bool = ...) -> None: ...
|
||||
|
||||
def dup2(fd: int, fd2: int, inheritable: bool = ...) -> int: ...
|
||||
def fstat(fd: int) -> stat_result: ...
|
||||
def ftruncate(__fd: int, __length: int) -> None: ...
|
||||
def fsync(fd: FileDescriptorLike) -> None: ...
|
||||
@@ -636,13 +624,12 @@ if sys.platform != "win32":
|
||||
if sys.platform != "darwin":
|
||||
if sys.version_info >= (3, 10):
|
||||
RWF_APPEND: int # docs say available on 3.7+, stubtest says otherwise
|
||||
if sys.version_info >= (3, 7):
|
||||
def preadv(__fd: int, __buffers: Iterable[bytes], __offset: int, __flags: int = ...) -> int: ...
|
||||
def pwritev(__fd: int, __buffers: Iterable[bytes], __offset: int, __flags: int = ...) -> int: ...
|
||||
RWF_DSYNC: int
|
||||
RWF_SYNC: int
|
||||
RWF_HIPRI: int
|
||||
RWF_NOWAIT: int
|
||||
def preadv(__fd: int, __buffers: Iterable[bytes], __offset: int, __flags: int = ...) -> int: ...
|
||||
def pwritev(__fd: int, __buffers: Iterable[bytes], __offset: int, __flags: int = ...) -> int: ...
|
||||
RWF_DSYNC: int
|
||||
RWF_SYNC: int
|
||||
RWF_HIPRI: int
|
||||
RWF_NOWAIT: int
|
||||
@overload
|
||||
def sendfile(out_fd: int, in_fd: int, offset: int | None, count: int) -> int: ...
|
||||
@overload
|
||||
@@ -742,21 +729,12 @@ class _ScandirIterator(Iterator[DirEntry[AnyStr]], AbstractContextManager[_Scand
|
||||
|
||||
@overload
|
||||
def scandir(path: None = ...) -> _ScandirIterator[str]: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
@overload
|
||||
def scandir(path: int) -> _ScandirIterator[str]: ...
|
||||
|
||||
@overload
|
||||
def scandir(path: int) -> _ScandirIterator[str]: ...
|
||||
@overload
|
||||
def scandir(path: GenericPath[AnyStr]) -> _ScandirIterator[AnyStr]: ...
|
||||
def stat(path: _FdOrAnyPath, *, dir_fd: int | None = ..., follow_symlinks: bool = ...) -> stat_result: ...
|
||||
|
||||
if sys.version_info < (3, 7):
|
||||
@overload
|
||||
def stat_float_times() -> bool: ...
|
||||
@overload
|
||||
def stat_float_times(__newvalue: bool) -> None: ...
|
||||
|
||||
if sys.platform != "win32":
|
||||
def statvfs(path: _FdOrAnyPath) -> statvfs_result: ... # Unix only
|
||||
|
||||
@@ -783,34 +761,19 @@ def walk(
|
||||
) -> Iterator[tuple[AnyStr, list[AnyStr], list[AnyStr]]]: ...
|
||||
|
||||
if sys.platform != "win32":
|
||||
if sys.version_info >= (3, 7):
|
||||
@overload
|
||||
def fwalk(
|
||||
top: StrPath = ...,
|
||||
topdown: bool = ...,
|
||||
onerror: _OnError | None = ...,
|
||||
*,
|
||||
follow_symlinks: bool = ...,
|
||||
dir_fd: int | None = ...,
|
||||
) -> Iterator[tuple[str, list[str], list[str], int]]: ...
|
||||
@overload
|
||||
def fwalk(
|
||||
top: bytes,
|
||||
topdown: bool = ...,
|
||||
onerror: _OnError | None = ...,
|
||||
*,
|
||||
follow_symlinks: bool = ...,
|
||||
dir_fd: int | None = ...,
|
||||
) -> Iterator[tuple[bytes, list[bytes], list[bytes], int]]: ...
|
||||
else:
|
||||
def fwalk(
|
||||
top: StrPath = ...,
|
||||
topdown: bool = ...,
|
||||
onerror: _OnError | None = ...,
|
||||
*,
|
||||
follow_symlinks: bool = ...,
|
||||
dir_fd: int | None = ...,
|
||||
) -> Iterator[tuple[str, list[str], list[str], int]]: ...
|
||||
@overload
|
||||
def fwalk(
|
||||
top: StrPath = ...,
|
||||
topdown: bool = ...,
|
||||
onerror: _OnError | None = ...,
|
||||
*,
|
||||
follow_symlinks: bool = ...,
|
||||
dir_fd: int | None = ...,
|
||||
) -> Iterator[tuple[str, list[str], list[str], int]]: ...
|
||||
@overload
|
||||
def fwalk(
|
||||
top: bytes, topdown: bool = ..., onerror: _OnError | None = ..., *, follow_symlinks: bool = ..., dir_fd: int | None = ...
|
||||
) -> Iterator[tuple[bytes, list[bytes], list[bytes], int]]: ...
|
||||
if sys.platform == "linux":
|
||||
def getxattr(path: _FdOrAnyPath, attribute: StrOrBytesPath, *, follow_symlinks: bool = ...) -> bytes: ...
|
||||
def listxattr(path: _FdOrAnyPath | None = ..., *, follow_symlinks: bool = ...) -> list[str]: ...
|
||||
@@ -999,7 +962,7 @@ if sys.platform == "linux":
|
||||
|
||||
def urandom(__size: int) -> bytes: ...
|
||||
|
||||
if sys.version_info >= (3, 7) and sys.platform != "win32":
|
||||
if sys.platform != "win32":
|
||||
def register_at_fork(
|
||||
*,
|
||||
before: Callable[..., Any] | None = ...,
|
||||
|
||||
+1
-2
@@ -159,8 +159,7 @@ class Path(PurePath):
|
||||
# so it's safer to pretend they don't exist
|
||||
def owner(self) -> str: ...
|
||||
def group(self) -> str: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def is_mount(self) -> bool: ...
|
||||
def is_mount(self) -> bool: ...
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
def readlink(self: Self) -> Self: ...
|
||||
|
||||
+2
-8
@@ -22,13 +22,7 @@ def run(statement: str, globals: dict[str, Any] | None = ..., locals: Mapping[st
|
||||
def runeval(expression: str, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> Any: ...
|
||||
def runctx(statement: str, globals: dict[str, Any], locals: Mapping[str, Any]) -> None: ...
|
||||
def runcall(func: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> _T | None: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def set_trace(*, header: str | None = ...) -> None: ...
|
||||
|
||||
else:
|
||||
def set_trace() -> None: ...
|
||||
|
||||
def set_trace(*, header: str | None = ...) -> None: ...
|
||||
def post_mortem(t: TracebackType | None = ...) -> None: ...
|
||||
def pm() -> None: ...
|
||||
|
||||
@@ -167,7 +161,7 @@ class Pdb(Bdb, Cmd):
|
||||
complete_whatis = _complete_expression
|
||||
complete_display = _complete_expression
|
||||
|
||||
if sys.version_info >= (3, 7) and sys.version_info < (3, 11):
|
||||
if sys.version_info < (3, 11):
|
||||
def _runmodule(self, module_name: str) -> None: ...
|
||||
|
||||
# undocumented
|
||||
|
||||
@@ -23,30 +23,13 @@ elif sys.version_info >= (3, 8):
|
||||
"dumps",
|
||||
"UID",
|
||||
]
|
||||
elif sys.version_info >= (3, 7):
|
||||
__all__ = [
|
||||
"readPlist",
|
||||
"writePlist",
|
||||
"readPlistFromBytes",
|
||||
"writePlistToBytes",
|
||||
"Data",
|
||||
"InvalidFileException",
|
||||
"FMT_XML",
|
||||
"FMT_BINARY",
|
||||
"load",
|
||||
"dump",
|
||||
"loads",
|
||||
"dumps",
|
||||
]
|
||||
else:
|
||||
__all__ = [
|
||||
"readPlist",
|
||||
"writePlist",
|
||||
"readPlistFromBytes",
|
||||
"writePlistToBytes",
|
||||
"Plist",
|
||||
"Data",
|
||||
"Dict",
|
||||
"InvalidFileException",
|
||||
"FMT_XML",
|
||||
"FMT_BINARY",
|
||||
@@ -105,21 +88,6 @@ if sys.version_info < (3, 9):
|
||||
def readPlistFromBytes(data: bytes) -> Any: ...
|
||||
def writePlistToBytes(value: Mapping[str, Any]) -> bytes: ...
|
||||
|
||||
if sys.version_info < (3, 7):
|
||||
class _InternalDict(dict[str, Any]):
|
||||
def __getattr__(self, attr: str) -> Any: ...
|
||||
def __setattr__(self, attr: str, value: Any) -> None: ...
|
||||
def __delattr__(self, attr: str) -> None: ...
|
||||
|
||||
class Dict(_InternalDict): # deprecated
|
||||
def __init__(self, **kwargs: Any) -> None: ...
|
||||
|
||||
class Plist(_InternalDict): # deprecated
|
||||
def __init__(self, **kwargs: Any) -> None: ...
|
||||
@classmethod
|
||||
def fromFile(cls: type[Self], pathOrFile: str | IO[bytes]) -> Self: ...
|
||||
def write(self, pathOrFile: str | IO[bytes]) -> None: ...
|
||||
|
||||
if sys.version_info < (3, 9):
|
||||
class Data:
|
||||
data: bytes
|
||||
|
||||
+10
-11
@@ -309,18 +309,17 @@ if sys.platform != "win32":
|
||||
copy_file_range as copy_file_range,
|
||||
memfd_create as memfd_create,
|
||||
)
|
||||
if sys.version_info >= (3, 7):
|
||||
from os import register_at_fork as register_at_fork
|
||||
from os import register_at_fork as register_at_fork
|
||||
|
||||
if sys.platform != "darwin":
|
||||
from os import (
|
||||
RWF_DSYNC as RWF_DSYNC,
|
||||
RWF_HIPRI as RWF_HIPRI,
|
||||
RWF_NOWAIT as RWF_NOWAIT,
|
||||
RWF_SYNC as RWF_SYNC,
|
||||
preadv as preadv,
|
||||
pwritev as pwritev,
|
||||
)
|
||||
if sys.platform != "darwin":
|
||||
from os import (
|
||||
RWF_DSYNC as RWF_DSYNC,
|
||||
RWF_HIPRI as RWF_HIPRI,
|
||||
RWF_NOWAIT as RWF_NOWAIT,
|
||||
RWF_SYNC as RWF_SYNC,
|
||||
preadv as preadv,
|
||||
pwritev as pwritev,
|
||||
)
|
||||
|
||||
# Not same as os.environ or os.environb
|
||||
# Because of this variable, we can't do "from posix import *" in os/__init__.pyi
|
||||
|
||||
+12
-16
@@ -2,32 +2,28 @@ import sys
|
||||
from _typeshed import Self, StrOrBytesPath
|
||||
from collections.abc import Iterable
|
||||
from cProfile import Profile as _cProfile
|
||||
from enum import Enum
|
||||
from profile import Profile
|
||||
from typing import IO, Any, overload
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
__all__ = ["Stats", "SortKey", "FunctionProfile", "StatsProfile"]
|
||||
elif sys.version_info >= (3, 7):
|
||||
__all__ = ["Stats", "SortKey"]
|
||||
else:
|
||||
__all__ = ["Stats"]
|
||||
__all__ = ["Stats", "SortKey"]
|
||||
|
||||
_Selector: TypeAlias = str | float | int
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from enum import Enum
|
||||
|
||||
class SortKey(str, Enum):
|
||||
CALLS: str
|
||||
CUMULATIVE: str
|
||||
FILENAME: str
|
||||
LINE: str
|
||||
NAME: str
|
||||
NFL: str
|
||||
PCALLS: str
|
||||
STDNAME: str
|
||||
TIME: str
|
||||
class SortKey(str, Enum):
|
||||
CALLS: str
|
||||
CUMULATIVE: str
|
||||
FILENAME: str
|
||||
LINE: str
|
||||
NAME: str
|
||||
NFL: str
|
||||
PCALLS: str
|
||||
STDNAME: str
|
||||
TIME: str
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from dataclasses import dataclass
|
||||
|
||||
+8
-17
@@ -1,10 +1,8 @@
|
||||
import enum
|
||||
import sys
|
||||
from typing import AnyStr
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ = ["compile", "main", "PyCompileError", "PycInvalidationMode"]
|
||||
else:
|
||||
__all__ = ["compile", "main", "PyCompileError"]
|
||||
__all__ = ["compile", "main", "PyCompileError", "PycInvalidationMode"]
|
||||
|
||||
class PyCompileError(Exception):
|
||||
exc_type_name: str
|
||||
@@ -13,14 +11,12 @@ class PyCompileError(Exception):
|
||||
msg: str
|
||||
def __init__(self, exc_type: type[BaseException], exc_value: BaseException, file: str, msg: str = ...) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
import enum
|
||||
class PycInvalidationMode(enum.Enum):
|
||||
TIMESTAMP: int
|
||||
CHECKED_HASH: int
|
||||
UNCHECKED_HASH: int
|
||||
|
||||
class PycInvalidationMode(enum.Enum):
|
||||
TIMESTAMP: int
|
||||
CHECKED_HASH: int
|
||||
UNCHECKED_HASH: int
|
||||
def _get_default_invalidation_mode() -> PycInvalidationMode: ...
|
||||
def _get_default_invalidation_mode() -> PycInvalidationMode: ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
def compile(
|
||||
@@ -33,7 +29,7 @@ if sys.version_info >= (3, 8):
|
||||
quiet: int = ...,
|
||||
) -> AnyStr | None: ...
|
||||
|
||||
elif sys.version_info >= (3, 7):
|
||||
else:
|
||||
def compile(
|
||||
file: AnyStr,
|
||||
cfile: AnyStr | None = ...,
|
||||
@@ -43,11 +39,6 @@ elif sys.version_info >= (3, 7):
|
||||
invalidation_mode: PycInvalidationMode | None = ...,
|
||||
) -> AnyStr | None: ...
|
||||
|
||||
else:
|
||||
def compile(
|
||||
file: AnyStr, cfile: AnyStr | None = ..., dfile: AnyStr | None = ..., doraise: bool = ..., optimize: int = ...
|
||||
) -> AnyStr | None: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
def main() -> None: ...
|
||||
|
||||
|
||||
+5
-9
@@ -14,9 +14,8 @@ class Class:
|
||||
if sys.version_info >= (3, 10):
|
||||
end_lineno: int | None
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
parent: Class | None
|
||||
children: dict[str, Class | Function]
|
||||
parent: Class | None
|
||||
children: dict[str, Class | Function]
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
def __init__(
|
||||
@@ -30,12 +29,10 @@ class Class:
|
||||
*,
|
||||
end_lineno: int | None = ...,
|
||||
) -> None: ...
|
||||
elif sys.version_info >= (3, 7):
|
||||
else:
|
||||
def __init__(
|
||||
self, module: str, name: str, super: list[Class | str] | None, file: str, lineno: int, parent: Class | None = ...
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, module: str, name: str, super: list[Class | str] | None, file: str, lineno: int) -> None: ...
|
||||
|
||||
class Function:
|
||||
module: str
|
||||
@@ -47,9 +44,8 @@ class Function:
|
||||
end_lineno: int | None
|
||||
is_async: bool
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
parent: Function | Class | None
|
||||
children: dict[str, Class | Function]
|
||||
parent: Function | Class | None
|
||||
children: dict[str, Class | Function]
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
def __init__(
|
||||
|
||||
+11
-15
@@ -5,10 +5,7 @@ from typing import Any, Generic, TypeVar
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ = ["Empty", "Full", "Queue", "PriorityQueue", "LifoQueue", "SimpleQueue"]
|
||||
else:
|
||||
__all__ = ["Empty", "Full", "Queue", "PriorityQueue", "LifoQueue"]
|
||||
__all__ = ["Empty", "Full", "Queue", "PriorityQueue", "LifoQueue", "SimpleQueue"]
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@@ -49,14 +46,13 @@ class PriorityQueue(Queue[_T]):
|
||||
class LifoQueue(Queue[_T]):
|
||||
queue: list[_T]
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
class SimpleQueue(Generic[_T]):
|
||||
def __init__(self) -> None: ...
|
||||
def empty(self) -> bool: ...
|
||||
def get(self, block: bool = ..., timeout: float | None = ...) -> _T: ...
|
||||
def get_nowait(self) -> _T: ...
|
||||
def put(self, item: _T, block: bool = ..., timeout: float | None = ...) -> None: ...
|
||||
def put_nowait(self, item: _T) -> None: ...
|
||||
def qsize(self) -> int: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
class SimpleQueue(Generic[_T]):
|
||||
def __init__(self) -> None: ...
|
||||
def empty(self) -> bool: ...
|
||||
def get(self, block: bool = ..., timeout: float | None = ...) -> _T: ...
|
||||
def get_nowait(self) -> _T: ...
|
||||
def put(self, item: _T, block: bool = ..., timeout: float | None = ...) -> None: ...
|
||||
def put_nowait(self, item: _T) -> None: ...
|
||||
def qsize(self) -> int: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
+5
-14
@@ -4,15 +4,9 @@ import sys
|
||||
from _typeshed import ReadableBuffer
|
||||
from collections.abc import Callable, Iterator
|
||||
from sre_constants import error as error
|
||||
from typing import Any, AnyStr, overload
|
||||
from typing import Any, AnyStr, Match as Match, Pattern as Pattern, overload
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
# ----- re variables and constants -----
|
||||
if sys.version_info >= (3, 7):
|
||||
from typing import Match as Match, Pattern as Pattern
|
||||
else:
|
||||
from typing import Match, Pattern
|
||||
|
||||
__all__ = [
|
||||
"match",
|
||||
"fullmatch",
|
||||
@@ -41,14 +35,15 @@ __all__ = [
|
||||
"DOTALL",
|
||||
"VERBOSE",
|
||||
"UNICODE",
|
||||
"Match",
|
||||
"Pattern",
|
||||
]
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ += ["Match", "Pattern"]
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
__all__ += ["NOFLAG", "RegexFlag"]
|
||||
|
||||
# ----- re variables and constants -----
|
||||
|
||||
class RegexFlag(enum.IntFlag):
|
||||
A = sre_compile.SRE_FLAG_ASCII
|
||||
ASCII = A
|
||||
@@ -91,10 +86,6 @@ if sys.version_info >= (3, 11):
|
||||
NOFLAG = RegexFlag.NOFLAG
|
||||
_FlagsType: TypeAlias = int | RegexFlag
|
||||
|
||||
if sys.version_info < (3, 7):
|
||||
# undocumented
|
||||
_pattern_type: type
|
||||
|
||||
# Type-wise the compile() overloads are unnecessary, they could also be modeled using
|
||||
# unions in the parameter types. However mypy has a bug regarding TypeVar
|
||||
# constraints (https://github.com/python/mypy/issues/11880),
|
||||
|
||||
+2
-5
@@ -30,11 +30,8 @@ class shlex(Iterable[str]):
|
||||
lineno: int
|
||||
token: str
|
||||
eof: str
|
||||
if sys.version_info >= (3, 7):
|
||||
@property
|
||||
def punctuation_chars(self) -> str: ...
|
||||
else:
|
||||
punctuation_chars: str
|
||||
@property
|
||||
def punctuation_chars(self) -> str: ...
|
||||
def __init__(
|
||||
self,
|
||||
instream: str | TextIO | None = ...,
|
||||
|
||||
+1
-8
@@ -155,14 +155,7 @@ def register_archive_format(
|
||||
name: str, function: Callable[[str, str], object], extra_args: None = ..., description: str = ...
|
||||
) -> None: ...
|
||||
def unregister_archive_format(name: str) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def unpack_archive(filename: StrPath, extract_dir: StrPath | None = ..., format: str | None = ...) -> None: ...
|
||||
|
||||
else:
|
||||
# See http://bugs.python.org/issue30218
|
||||
def unpack_archive(filename: str, extract_dir: StrPath | None = ..., format: str | None = ...) -> None: ...
|
||||
|
||||
def unpack_archive(filename: StrPath, extract_dir: StrPath | None = ..., format: str | None = ...) -> None: ...
|
||||
@overload
|
||||
def register_unpack_format(
|
||||
name: str,
|
||||
|
||||
+1
-5
@@ -174,11 +174,7 @@ if sys.version_info >= (3, 8):
|
||||
def valid_signals() -> set[Signals]: ...
|
||||
def raise_signal(__signalnum: _SIGNUM) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def set_wakeup_fd(fd: int, *, warn_on_full_buffer: bool = ...) -> int: ...
|
||||
|
||||
else:
|
||||
def set_wakeup_fd(fd: int) -> int: ...
|
||||
def set_wakeup_fd(fd: int, *, warn_on_full_buffer: bool = ...) -> int: ...
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
if sys.platform == "linux":
|
||||
|
||||
+1
-3
@@ -22,11 +22,9 @@ __all__ = [
|
||||
"quotedata",
|
||||
"SMTP",
|
||||
"SMTP_SSL",
|
||||
"SMTPNotSupportedError",
|
||||
]
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ += ["SMTPNotSupportedError"]
|
||||
|
||||
_Reply: TypeAlias = tuple[int, bytes]
|
||||
_SendErrs: TypeAlias = dict[str, _Reply]
|
||||
# Should match source_address for socket.create_connection
|
||||
|
||||
+9
-19
@@ -138,14 +138,10 @@ if sys.version_info >= (3, 10):
|
||||
elif sys.platform != "darwin" and sys.platform != "win32":
|
||||
from _socket import IP_RECVTOS as IP_RECVTOS
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from _socket import close as close
|
||||
from _socket import TCP_KEEPINTVL as TCP_KEEPINTVL, close as close
|
||||
|
||||
if sys.platform != "win32" or sys.version_info >= (3, 7):
|
||||
from _socket import TCP_KEEPINTVL as TCP_KEEPINTVL
|
||||
|
||||
if sys.platform != "darwin":
|
||||
from _socket import TCP_KEEPIDLE as TCP_KEEPIDLE
|
||||
if sys.platform != "darwin":
|
||||
from _socket import TCP_KEEPIDLE as TCP_KEEPIDLE
|
||||
|
||||
if sys.platform != "win32" or sys.version_info >= (3, 8):
|
||||
from _socket import (
|
||||
@@ -358,7 +354,7 @@ if sys.platform == "linux":
|
||||
TIPC_WITHDRAWN as TIPC_WITHDRAWN,
|
||||
TIPC_ZONE_SCOPE as TIPC_ZONE_SCOPE,
|
||||
)
|
||||
if sys.platform == "linux" and sys.version_info >= (3, 7):
|
||||
if sys.platform == "linux":
|
||||
from _socket import (
|
||||
CAN_ISOTP as CAN_ISOTP,
|
||||
IOCTL_VM_SOCKETS_GET_LOCAL_CID as IOCTL_VM_SOCKETS_GET_LOCAL_CID,
|
||||
@@ -370,7 +366,7 @@ if sys.platform == "linux" and sys.version_info >= (3, 7):
|
||||
VMADDR_CID_HOST as VMADDR_CID_HOST,
|
||||
VMADDR_PORT_ANY as VMADDR_PORT_ANY,
|
||||
)
|
||||
if sys.platform != "win32" and sys.version_info >= (3, 7):
|
||||
if sys.platform != "win32":
|
||||
from _socket import TCP_NOTSENT_LOWAT as TCP_NOTSENT_LOWAT
|
||||
if sys.platform == "linux" and sys.version_info >= (3, 8):
|
||||
from _socket import (
|
||||
@@ -473,8 +469,7 @@ class AddressFamily(IntEnum):
|
||||
AF_TIPC: int
|
||||
AF_ALG: int
|
||||
AF_NETLINK: int
|
||||
if sys.version_info >= (3, 7):
|
||||
AF_VSOCK: int
|
||||
AF_VSOCK: int
|
||||
if sys.version_info >= (3, 8):
|
||||
AF_QIPCRTR: int
|
||||
if sys.platform != "win32" or sys.version_info >= (3, 9):
|
||||
@@ -523,8 +518,7 @@ if sys.platform == "linux":
|
||||
AF_TIPC = AddressFamily.AF_TIPC
|
||||
AF_ALG = AddressFamily.AF_ALG
|
||||
AF_NETLINK = AddressFamily.AF_NETLINK
|
||||
if sys.version_info >= (3, 7):
|
||||
AF_VSOCK = AddressFamily.AF_VSOCK
|
||||
AF_VSOCK = AddressFamily.AF_VSOCK
|
||||
if sys.version_info >= (3, 8):
|
||||
AF_QIPCRTR = AddressFamily.AF_QIPCRTR
|
||||
|
||||
@@ -563,9 +557,7 @@ class MsgFlag(IntFlag):
|
||||
if sys.platform != "darwin":
|
||||
MSG_BCAST: int
|
||||
MSG_MCAST: int
|
||||
|
||||
if sys.platform != "win32" or sys.version_info >= (3, 7):
|
||||
MSG_ERRQUEUE: int
|
||||
MSG_ERRQUEUE: int
|
||||
|
||||
if sys.platform != "win32" and sys.platform != "darwin":
|
||||
MSG_BTAG: int
|
||||
@@ -592,9 +584,7 @@ MSG_WAITALL = MsgFlag.MSG_WAITALL
|
||||
if sys.platform != "darwin":
|
||||
MSG_BCAST = MsgFlag.MSG_BCAST
|
||||
MSG_MCAST = MsgFlag.MSG_MCAST
|
||||
|
||||
if sys.platform != "win32" or sys.version_info >= (3, 7):
|
||||
MSG_ERRQUEUE = MsgFlag.MSG_ERRQUEUE
|
||||
MSG_ERRQUEUE = MsgFlag.MSG_ERRQUEUE
|
||||
|
||||
if sys.platform != "win32":
|
||||
MSG_DONTWAIT = MsgFlag.MSG_DONTWAIT
|
||||
|
||||
@@ -108,8 +108,7 @@ if sys.platform != "win32":
|
||||
timeout: float | None # undocumented
|
||||
active_children: set[int] | None # undocumented
|
||||
max_children: int # undocumented
|
||||
if sys.version_info >= (3, 7):
|
||||
block_on_close: bool
|
||||
block_on_close: bool
|
||||
def collect_children(self, *, blocking: bool = ...) -> None: ... # undocumented
|
||||
def handle_timeout(self) -> None: ... # undocumented
|
||||
def service_actions(self) -> None: ... # undocumented
|
||||
@@ -118,8 +117,7 @@ if sys.platform != "win32":
|
||||
|
||||
class ThreadingMixIn:
|
||||
daemon_threads: bool
|
||||
if sys.version_info >= (3, 7):
|
||||
block_on_close: bool
|
||||
block_on_close: bool
|
||||
def process_request_thread(self, request: _RequestType, client_address: _AddressType) -> None: ... # undocumented
|
||||
def process_request(self, request: _RequestType, client_address: _AddressType) -> None: ...
|
||||
def server_close(self) -> None: ...
|
||||
|
||||
+17
-28
@@ -48,13 +48,11 @@ SQLITE_CREATE_TEMP_TRIGGER: int
|
||||
SQLITE_CREATE_TEMP_VIEW: int
|
||||
SQLITE_CREATE_TRIGGER: int
|
||||
SQLITE_CREATE_VIEW: int
|
||||
if sys.version_info >= (3, 7):
|
||||
SQLITE_CREATE_VTABLE: int
|
||||
SQLITE_CREATE_VTABLE: int
|
||||
SQLITE_DELETE: int
|
||||
SQLITE_DENY: int
|
||||
SQLITE_DETACH: int
|
||||
if sys.version_info >= (3, 7):
|
||||
SQLITE_DONE: int
|
||||
SQLITE_DONE: int
|
||||
SQLITE_DROP_INDEX: int
|
||||
SQLITE_DROP_TABLE: int
|
||||
SQLITE_DROP_TEMP_INDEX: int
|
||||
@@ -63,9 +61,8 @@ SQLITE_DROP_TEMP_TRIGGER: int
|
||||
SQLITE_DROP_TEMP_VIEW: int
|
||||
SQLITE_DROP_TRIGGER: int
|
||||
SQLITE_DROP_VIEW: int
|
||||
if sys.version_info >= (3, 7):
|
||||
SQLITE_DROP_VTABLE: int
|
||||
SQLITE_FUNCTION: int
|
||||
SQLITE_DROP_VTABLE: int
|
||||
SQLITE_FUNCTION: int
|
||||
SQLITE_IGNORE: int
|
||||
SQLITE_INSERT: int
|
||||
SQLITE_OK: int
|
||||
@@ -85,9 +82,8 @@ if sys.version_info >= (3, 11):
|
||||
SQLITE_PRAGMA: int
|
||||
SQLITE_READ: int
|
||||
SQLITE_REINDEX: int
|
||||
if sys.version_info >= (3, 7):
|
||||
SQLITE_RECURSIVE: int
|
||||
SQLITE_SAVEPOINT: int
|
||||
SQLITE_RECURSIVE: int
|
||||
SQLITE_SAVEPOINT: int
|
||||
SQLITE_SELECT: int
|
||||
SQLITE_TRANSACTION: int
|
||||
SQLITE_UPDATE: int
|
||||
@@ -207,14 +203,8 @@ def adapt(__obj: Any, __proto: Any) -> Any: ...
|
||||
@overload
|
||||
def adapt(__obj: Any, __proto: Any, __alt: _T) -> Any | _T: ...
|
||||
def complete_statement(statement: str) -> bool: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
_DatabaseArg: TypeAlias = StrOrBytesPath
|
||||
else:
|
||||
_DatabaseArg: TypeAlias = bytes | str
|
||||
|
||||
def connect(
|
||||
database: _DatabaseArg,
|
||||
database: StrOrBytesPath,
|
||||
timeout: float = ...,
|
||||
detect_types: int = ...,
|
||||
isolation_level: str | None = ...,
|
||||
@@ -288,7 +278,7 @@ class Connection:
|
||||
text_factory: Any
|
||||
def __init__(
|
||||
self,
|
||||
database: _DatabaseArg,
|
||||
database: StrOrBytesPath,
|
||||
timeout: float = ...,
|
||||
detect_types: int = ...,
|
||||
isolation_level: str | None = ...,
|
||||
@@ -347,16 +337,15 @@ class Connection:
|
||||
# without sqlite3 loadable extension support. see footnotes https://docs.python.org/3/library/sqlite3.html#f1
|
||||
def enable_load_extension(self, __enabled: bool) -> None: ...
|
||||
def load_extension(self, __name: str) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def backup(
|
||||
self,
|
||||
target: Connection,
|
||||
*,
|
||||
pages: int = ...,
|
||||
progress: Callable[[int, int, int], object] | None = ...,
|
||||
name: str = ...,
|
||||
sleep: float = ...,
|
||||
) -> None: ...
|
||||
def backup(
|
||||
self,
|
||||
target: Connection,
|
||||
*,
|
||||
pages: int = ...,
|
||||
progress: Callable[[int, int, int], object] | None = ...,
|
||||
name: str = ...,
|
||||
sleep: float = ...,
|
||||
) -> None: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def setlimit(self, __category: int, __limit: int) -> int: ...
|
||||
def getlimit(self, __category: int) -> int: ...
|
||||
|
||||
+11
-15
@@ -23,9 +23,8 @@ OPCODES: list[_NamedIntConstant]
|
||||
ATCODES: list[_NamedIntConstant]
|
||||
CHCODES: list[_NamedIntConstant]
|
||||
OP_IGNORE: dict[_NamedIntConstant, _NamedIntConstant]
|
||||
if sys.version_info >= (3, 7):
|
||||
OP_LOCALE_IGNORE: dict[_NamedIntConstant, _NamedIntConstant]
|
||||
OP_UNICODE_IGNORE: dict[_NamedIntConstant, _NamedIntConstant]
|
||||
OP_LOCALE_IGNORE: dict[_NamedIntConstant, _NamedIntConstant]
|
||||
OP_UNICODE_IGNORE: dict[_NamedIntConstant, _NamedIntConstant]
|
||||
AT_MULTILINE: dict[_NamedIntConstant, _NamedIntConstant]
|
||||
AT_LOCALE: dict[_NamedIntConstant, _NamedIntConstant]
|
||||
AT_UNICODE: dict[_NamedIntConstant, _NamedIntConstant]
|
||||
@@ -80,18 +79,15 @@ REPEAT: _NamedIntConstant
|
||||
REPEAT_ONE: _NamedIntConstant
|
||||
SUBPATTERN: _NamedIntConstant
|
||||
MIN_REPEAT_ONE: _NamedIntConstant
|
||||
if sys.version_info >= (3, 7):
|
||||
RANGE_UNI_IGNORE: _NamedIntConstant
|
||||
GROUPREF_LOC_IGNORE: _NamedIntConstant
|
||||
GROUPREF_UNI_IGNORE: _NamedIntConstant
|
||||
IN_LOC_IGNORE: _NamedIntConstant
|
||||
IN_UNI_IGNORE: _NamedIntConstant
|
||||
LITERAL_LOC_IGNORE: _NamedIntConstant
|
||||
LITERAL_UNI_IGNORE: _NamedIntConstant
|
||||
NOT_LITERAL_LOC_IGNORE: _NamedIntConstant
|
||||
NOT_LITERAL_UNI_IGNORE: _NamedIntConstant
|
||||
else:
|
||||
RANGE_IGNORE: _NamedIntConstant
|
||||
RANGE_UNI_IGNORE: _NamedIntConstant
|
||||
GROUPREF_LOC_IGNORE: _NamedIntConstant
|
||||
GROUPREF_UNI_IGNORE: _NamedIntConstant
|
||||
IN_LOC_IGNORE: _NamedIntConstant
|
||||
IN_UNI_IGNORE: _NamedIntConstant
|
||||
LITERAL_LOC_IGNORE: _NamedIntConstant
|
||||
LITERAL_UNI_IGNORE: _NamedIntConstant
|
||||
NOT_LITERAL_LOC_IGNORE: _NamedIntConstant
|
||||
NOT_LITERAL_UNI_IGNORE: _NamedIntConstant
|
||||
MIN_REPEAT: _NamedIntConstant
|
||||
MAX_REPEAT: _NamedIntConstant
|
||||
|
||||
|
||||
@@ -15,8 +15,7 @@ WHITESPACE: frozenset[str]
|
||||
ESCAPES: dict[str, tuple[_NIC, int]]
|
||||
CATEGORIES: dict[str, tuple[_NIC, _NIC] | tuple[_NIC, list[tuple[_NIC, _NIC]]]]
|
||||
FLAGS: dict[str, int]
|
||||
if sys.version_info >= (3, 7):
|
||||
TYPE_FLAGS: int
|
||||
TYPE_FLAGS: int
|
||||
GLOBAL_FLAGS: int
|
||||
|
||||
if sys.version_info < (3, 11):
|
||||
|
||||
+45
-100
@@ -38,13 +38,11 @@ class SSLWantWriteError(SSLError): ...
|
||||
class SSLSyscallError(SSLError): ...
|
||||
class SSLEOFError(SSLError): ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
class SSLCertVerificationError(SSLError, ValueError):
|
||||
verify_code: int
|
||||
verify_message: str
|
||||
CertificateError = SSLCertVerificationError
|
||||
else:
|
||||
class CertificateError(ValueError): ...
|
||||
class SSLCertVerificationError(SSLError, ValueError):
|
||||
verify_code: int
|
||||
verify_message: str
|
||||
|
||||
CertificateError = SSLCertVerificationError
|
||||
|
||||
def wrap_socket(
|
||||
sock: socket.socket,
|
||||
@@ -65,34 +63,18 @@ def create_default_context(
|
||||
capath: StrOrBytesPath | None = ...,
|
||||
cadata: str | bytes | None = ...,
|
||||
) -> SSLContext: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def _create_unverified_context(
|
||||
protocol: int = ...,
|
||||
*,
|
||||
cert_reqs: int = ...,
|
||||
check_hostname: bool = ...,
|
||||
purpose: Purpose = ...,
|
||||
certfile: StrOrBytesPath | None = ...,
|
||||
keyfile: StrOrBytesPath | None = ...,
|
||||
cafile: StrOrBytesPath | None = ...,
|
||||
capath: StrOrBytesPath | None = ...,
|
||||
cadata: str | bytes | None = ...,
|
||||
) -> SSLContext: ...
|
||||
|
||||
else:
|
||||
def _create_unverified_context(
|
||||
protocol: int = ...,
|
||||
*,
|
||||
cert_reqs: int | None = ...,
|
||||
check_hostname: bool = ...,
|
||||
purpose: Purpose = ...,
|
||||
certfile: StrOrBytesPath | None = ...,
|
||||
keyfile: StrOrBytesPath | None = ...,
|
||||
cafile: StrOrBytesPath | None = ...,
|
||||
capath: StrOrBytesPath | None = ...,
|
||||
cadata: str | bytes | None = ...,
|
||||
) -> SSLContext: ...
|
||||
def _create_unverified_context(
|
||||
protocol: int = ...,
|
||||
*,
|
||||
cert_reqs: int = ...,
|
||||
check_hostname: bool = ...,
|
||||
purpose: Purpose = ...,
|
||||
certfile: StrOrBytesPath | None = ...,
|
||||
keyfile: StrOrBytesPath | None = ...,
|
||||
cafile: StrOrBytesPath | None = ...,
|
||||
capath: StrOrBytesPath | None = ...,
|
||||
cadata: str | bytes | None = ...,
|
||||
) -> SSLContext: ...
|
||||
|
||||
_create_default_https_context: Callable[..., SSLContext]
|
||||
|
||||
@@ -192,8 +174,7 @@ class Options(enum.IntFlag):
|
||||
OP_SINGLE_ECDH_USE: int
|
||||
OP_NO_COMPRESSION: int
|
||||
OP_NO_TICKET: int
|
||||
if sys.version_info >= (3, 7):
|
||||
OP_NO_RENEGOTIATION: int
|
||||
OP_NO_RENEGOTIATION: int
|
||||
if sys.version_info >= (3, 8):
|
||||
OP_ENABLE_MIDDLEBOX_COMPAT: int
|
||||
|
||||
@@ -209,18 +190,16 @@ OP_SINGLE_DH_USE: Options
|
||||
OP_SINGLE_ECDH_USE: Options
|
||||
OP_NO_COMPRESSION: Options
|
||||
OP_NO_TICKET: Options
|
||||
if sys.version_info >= (3, 7):
|
||||
OP_NO_RENEGOTIATION: Options
|
||||
OP_NO_RENEGOTIATION: Options
|
||||
if sys.version_info >= (3, 8):
|
||||
OP_ENABLE_MIDDLEBOX_COMPAT: Options
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
HAS_NEVER_CHECK_COMMON_NAME: bool
|
||||
HAS_SSLv2: bool
|
||||
HAS_SSLv3: bool
|
||||
HAS_TLSv1: bool
|
||||
HAS_TLSv1_1: bool
|
||||
HAS_TLSv1_2: bool
|
||||
HAS_NEVER_CHECK_COMMON_NAME: bool
|
||||
HAS_SSLv2: bool
|
||||
HAS_SSLv3: bool
|
||||
HAS_TLSv1: bool
|
||||
HAS_TLSv1_1: bool
|
||||
HAS_TLSv1_2: bool
|
||||
HAS_TLSv1_3: bool
|
||||
HAS_ALPN: bool
|
||||
HAS_ECDH: bool
|
||||
@@ -310,31 +289,7 @@ class SSLSocket(socket.socket):
|
||||
session: SSLSession | None
|
||||
@property
|
||||
def session_reused(self) -> bool | None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
sock: socket.socket | None = ...,
|
||||
keyfile: str | None = ...,
|
||||
certfile: str | None = ...,
|
||||
server_side: bool = ...,
|
||||
cert_reqs: int = ...,
|
||||
ssl_version: int = ...,
|
||||
ca_certs: str | None = ...,
|
||||
do_handshake_on_connect: bool = ...,
|
||||
family: int = ...,
|
||||
type: int = ...,
|
||||
proto: int = ...,
|
||||
fileno: int | None = ...,
|
||||
suppress_ragged_eofs: bool = ...,
|
||||
npn_protocols: Iterable[str] | None = ...,
|
||||
ciphers: str | None = ...,
|
||||
server_hostname: str | None = ...,
|
||||
_context: SSLContext | None = ...,
|
||||
_session: Any | None = ...,
|
||||
) -> None: ...
|
||||
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> 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: ...
|
||||
@@ -372,15 +327,14 @@ class SSLSocket(socket.socket):
|
||||
if sys.version_info >= (3, 8):
|
||||
def verify_client_post_handshake(self) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
class TLSVersion(enum.IntEnum):
|
||||
MINIMUM_SUPPORTED: int
|
||||
MAXIMUM_SUPPORTED: int
|
||||
SSLv3: int
|
||||
TLSv1: int
|
||||
TLSv1_1: int
|
||||
TLSv1_2: int
|
||||
TLSv1_3: int
|
||||
class TLSVersion(enum.IntEnum):
|
||||
MINIMUM_SUPPORTED: int
|
||||
MAXIMUM_SUPPORTED: int
|
||||
SSLv3: int
|
||||
TLSv1: int
|
||||
TLSv1_1: int
|
||||
TLSv1_2: int
|
||||
TLSv1_3: int
|
||||
|
||||
class SSLContext:
|
||||
check_hostname: bool
|
||||
@@ -389,16 +343,15 @@ class SSLContext:
|
||||
verify_mode: VerifyMode
|
||||
@property
|
||||
def protocol(self) -> _SSLMethod: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
hostname_checks_common_name: bool
|
||||
maximum_version: TLSVersion
|
||||
minimum_version: TLSVersion
|
||||
sni_callback: Callable[[SSLObject, str, SSLContext], None | int] | None
|
||||
# The following two attributes have class-level defaults.
|
||||
# However, the docs explicitly state that it's OK to override these attributes on instances,
|
||||
# so making these ClassVars wouldn't be appropriate
|
||||
sslobject_class: type[SSLObject]
|
||||
sslsocket_class: type[SSLSocket]
|
||||
hostname_checks_common_name: bool
|
||||
maximum_version: TLSVersion
|
||||
minimum_version: TLSVersion
|
||||
sni_callback: Callable[[SSLObject, str, SSLContext], None | int] | None
|
||||
# The following two attributes have class-level defaults.
|
||||
# However, the docs explicitly state that it's OK to override these attributes on instances,
|
||||
# so making these ClassVars wouldn't be appropriate
|
||||
sslobject_class: type[SSLObject]
|
||||
sslsocket_class: type[SSLSocket]
|
||||
if sys.version_info >= (3, 8):
|
||||
keylog_filename: str
|
||||
post_handshake_auth: bool
|
||||
@@ -423,11 +376,7 @@ class SSLContext:
|
||||
def set_ciphers(self, __cipherlist: str) -> None: ...
|
||||
def set_alpn_protocols(self, alpn_protocols: Iterable[str]) -> None: ...
|
||||
def set_npn_protocols(self, npn_protocols: Iterable[str]) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def set_servername_callback(self, server_name_callback: _SrvnmeCbType | None) -> None: ...
|
||||
else:
|
||||
def set_servername_callback(self, __method: _SrvnmeCbType | None) -> None: ...
|
||||
|
||||
def set_servername_callback(self, server_name_callback: _SrvnmeCbType | None) -> None: ...
|
||||
def load_dh_params(self, __path: str) -> None: ...
|
||||
def set_ecdh_curve(self, __name: str) -> None: ...
|
||||
def wrap_socket(
|
||||
@@ -458,11 +407,7 @@ class SSLObject:
|
||||
session: SSLSession | None
|
||||
@property
|
||||
def session_reused(self) -> bool: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
else:
|
||||
def __init__(self, sslobj: Any, owner: SSLSocket | SSLObject | None = ..., session: Any | None = ...) -> None: ...
|
||||
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def read(self, len: int = ..., buffer: bytearray | None = ...) -> bytes: ...
|
||||
def write(self, data: bytes) -> int: ...
|
||||
@overload
|
||||
|
||||
+1
-5
@@ -1,4 +1,3 @@
|
||||
import sys
|
||||
from _typeshed import ReadableBuffer, WriteableBuffer
|
||||
from collections.abc import Iterator
|
||||
from typing import Any
|
||||
@@ -15,10 +14,7 @@ def iter_unpack(__format: str | bytes, __buffer: ReadableBuffer) -> Iterator[tup
|
||||
def calcsize(__format: str | bytes) -> int: ...
|
||||
|
||||
class Struct:
|
||||
if sys.version_info >= (3, 7):
|
||||
format: str
|
||||
else:
|
||||
format: bytes
|
||||
format: str
|
||||
size: int
|
||||
def __init__(self, format: str | bytes) -> None: ...
|
||||
def pack(self, *v: Any) -> bytes: ...
|
||||
|
||||
+37
-477
@@ -36,22 +36,18 @@ if sys.platform == "win32":
|
||||
"STD_INPUT_HANDLE",
|
||||
"STD_OUTPUT_HANDLE",
|
||||
"SW_HIDE",
|
||||
"ABOVE_NORMAL_PRIORITY_CLASS",
|
||||
"BELOW_NORMAL_PRIORITY_CLASS",
|
||||
"CREATE_BREAKAWAY_FROM_JOB",
|
||||
"CREATE_DEFAULT_ERROR_MODE",
|
||||
"CREATE_NO_WINDOW",
|
||||
"DETACHED_PROCESS",
|
||||
"HIGH_PRIORITY_CLASS",
|
||||
"IDLE_PRIORITY_CLASS",
|
||||
"NORMAL_PRIORITY_CLASS",
|
||||
"REALTIME_PRIORITY_CLASS",
|
||||
]
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ += [
|
||||
"ABOVE_NORMAL_PRIORITY_CLASS",
|
||||
"BELOW_NORMAL_PRIORITY_CLASS",
|
||||
"CREATE_BREAKAWAY_FROM_JOB",
|
||||
"CREATE_DEFAULT_ERROR_MODE",
|
||||
"CREATE_NO_WINDOW",
|
||||
"DETACHED_PROCESS",
|
||||
"HIGH_PRIORITY_CLASS",
|
||||
"IDLE_PRIORITY_CLASS",
|
||||
"NORMAL_PRIORITY_CLASS",
|
||||
"REALTIME_PRIORITY_CLASS",
|
||||
]
|
||||
|
||||
# We prefer to annotate inputs to methods (eg subprocess.check_call) with these
|
||||
# union types.
|
||||
# For outputs we use laborious literal based overloads to try to determine
|
||||
@@ -707,7 +703,7 @@ elif sys.version_info >= (3, 9):
|
||||
umask: int = ...,
|
||||
) -> CompletedProcess[Any]: ...
|
||||
|
||||
elif sys.version_info >= (3, 7):
|
||||
else:
|
||||
# Nearly the same args as for 3.6, except for capture_output and text
|
||||
@overload
|
||||
def run(
|
||||
@@ -879,140 +875,6 @@ elif sys.version_info >= (3, 7):
|
||||
timeout: float | None = ...,
|
||||
) -> CompletedProcess[Any]: ...
|
||||
|
||||
else:
|
||||
# Nearly same args as Popen.__init__ except for timeout, input, and check
|
||||
@overload
|
||||
def run(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
check: bool = ...,
|
||||
encoding: str,
|
||||
errors: str | None = ...,
|
||||
input: str | None = ...,
|
||||
timeout: float | None = ...,
|
||||
) -> CompletedProcess[str]: ...
|
||||
@overload
|
||||
def run(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
check: bool = ...,
|
||||
encoding: str | None = ...,
|
||||
errors: str,
|
||||
input: str | None = ...,
|
||||
timeout: float | None = ...,
|
||||
) -> CompletedProcess[str]: ...
|
||||
@overload
|
||||
def run(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
*,
|
||||
universal_newlines: Literal[True],
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
# where the *real* keyword only args start
|
||||
check: bool = ...,
|
||||
encoding: str | None = ...,
|
||||
errors: str | None = ...,
|
||||
input: str | None = ...,
|
||||
timeout: float | None = ...,
|
||||
) -> CompletedProcess[str]: ...
|
||||
@overload
|
||||
def run(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: Literal[False] = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
check: bool = ...,
|
||||
encoding: None = ...,
|
||||
errors: None = ...,
|
||||
input: bytes | None = ...,
|
||||
timeout: float | None = ...,
|
||||
) -> CompletedProcess[bytes]: ...
|
||||
@overload
|
||||
def run(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
check: bool = ...,
|
||||
encoding: str | None = ...,
|
||||
errors: str | None = ...,
|
||||
input: _TXT | None = ...,
|
||||
timeout: float | None = ...,
|
||||
) -> CompletedProcess[Any]: ...
|
||||
|
||||
# Same args as Popen.__init__
|
||||
if sys.version_info >= (3, 11):
|
||||
# 3.11 adds "process_group" argument
|
||||
@@ -1104,31 +966,6 @@ elif sys.version_info >= (3, 9):
|
||||
umask: int = ...,
|
||||
) -> int: ...
|
||||
|
||||
elif sys.version_info >= (3, 7):
|
||||
# 3.7 adds the "text" argument
|
||||
def call(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
timeout: float | None = ...,
|
||||
text: bool | None = ...,
|
||||
) -> int: ...
|
||||
|
||||
else:
|
||||
def call(
|
||||
args: _CMD,
|
||||
@@ -1150,6 +987,7 @@ else:
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
timeout: float | None = ...,
|
||||
text: bool | None = ...,
|
||||
) -> int: ...
|
||||
|
||||
# Same args as Popen.__init__
|
||||
@@ -1243,8 +1081,7 @@ elif sys.version_info >= (3, 9):
|
||||
umask: int = ...,
|
||||
) -> int: ...
|
||||
|
||||
elif sys.version_info >= (3, 7):
|
||||
# 3.7 adds the "text" argument
|
||||
else:
|
||||
def check_call(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
@@ -1268,28 +1105,6 @@ elif sys.version_info >= (3, 7):
|
||||
text: bool | None = ...,
|
||||
) -> int: ...
|
||||
|
||||
else:
|
||||
def check_call(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath = ...,
|
||||
stdin: _FILE = ...,
|
||||
stdout: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
timeout: float | None = ...,
|
||||
) -> int: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
# 3.11 adds "process_group" argument
|
||||
@overload
|
||||
@@ -1842,8 +1657,7 @@ elif sys.version_info >= (3, 9):
|
||||
umask: int = ...,
|
||||
) -> Any: ... # morally: -> _TXT
|
||||
|
||||
elif sys.version_info >= (3, 7):
|
||||
# 3.7 added text
|
||||
else:
|
||||
@overload
|
||||
def check_output(
|
||||
args: _CMD,
|
||||
@@ -1996,128 +1810,6 @@ elif sys.version_info >= (3, 7):
|
||||
text: bool | None = ...,
|
||||
) -> Any: ... # morally: -> _TXT
|
||||
|
||||
else:
|
||||
@overload
|
||||
def check_output(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
timeout: float | None = ...,
|
||||
input: _TXT | None = ...,
|
||||
encoding: str,
|
||||
errors: str | None = ...,
|
||||
) -> str: ...
|
||||
@overload
|
||||
def check_output(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
timeout: float | None = ...,
|
||||
input: _TXT | None = ...,
|
||||
encoding: str | None = ...,
|
||||
errors: str,
|
||||
) -> str: ...
|
||||
@overload
|
||||
def check_output(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
universal_newlines: Literal[True],
|
||||
timeout: float | None = ...,
|
||||
input: _TXT | None = ...,
|
||||
encoding: str | None = ...,
|
||||
errors: str | None = ...,
|
||||
) -> str: ...
|
||||
@overload
|
||||
def check_output(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: Literal[False] = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
timeout: float | None = ...,
|
||||
input: _TXT | None = ...,
|
||||
encoding: None = ...,
|
||||
errors: None = ...,
|
||||
) -> bytes: ...
|
||||
@overload
|
||||
def check_output(
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE = ...,
|
||||
stderr: _FILE = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
timeout: float | None = ...,
|
||||
input: _TXT | None = ...,
|
||||
encoding: str | None = ...,
|
||||
errors: str | None = ...,
|
||||
) -> Any: ... # morally: -> _TXT
|
||||
|
||||
PIPE: int
|
||||
STDOUT: int
|
||||
DEVNULL: int
|
||||
@@ -2704,8 +2396,7 @@ class Popen(Generic[AnyStr]):
|
||||
extra_groups: Iterable[str | int] | None = ...,
|
||||
umask: int = ...,
|
||||
) -> None: ...
|
||||
elif sys.version_info >= (3, 7):
|
||||
# text is added in 3.7
|
||||
else:
|
||||
@overload
|
||||
def __init__(
|
||||
self: Popen[str],
|
||||
@@ -2857,134 +2548,9 @@ class Popen(Generic[AnyStr]):
|
||||
encoding: str | None = ...,
|
||||
errors: str | None = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
@overload
|
||||
def __init__(
|
||||
self: Popen[str],
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
encoding: str,
|
||||
errors: str | None = ...,
|
||||
) -> None: ...
|
||||
@overload
|
||||
def __init__(
|
||||
self: Popen[str],
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
encoding: str | None = ...,
|
||||
errors: str,
|
||||
) -> None: ...
|
||||
@overload
|
||||
def __init__(
|
||||
self: Popen[str],
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
*,
|
||||
universal_newlines: Literal[True],
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
# where the *real* keyword only args start
|
||||
encoding: str | None = ...,
|
||||
errors: str | None = ...,
|
||||
) -> None: ...
|
||||
@overload
|
||||
def __init__(
|
||||
self: Popen[bytes],
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: Literal[False] = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
encoding: None = ...,
|
||||
errors: None = ...,
|
||||
) -> None: ...
|
||||
@overload
|
||||
def __init__(
|
||||
self: Popen[Any],
|
||||
args: _CMD,
|
||||
bufsize: int = ...,
|
||||
executable: StrOrBytesPath | None = ...,
|
||||
stdin: _FILE | None = ...,
|
||||
stdout: _FILE | None = ...,
|
||||
stderr: _FILE | None = ...,
|
||||
preexec_fn: Callable[[], Any] | None = ...,
|
||||
close_fds: bool = ...,
|
||||
shell: bool = ...,
|
||||
cwd: StrOrBytesPath | None = ...,
|
||||
env: _ENV | None = ...,
|
||||
universal_newlines: bool = ...,
|
||||
startupinfo: Any | None = ...,
|
||||
creationflags: int = ...,
|
||||
restore_signals: bool = ...,
|
||||
start_new_session: bool = ...,
|
||||
pass_fds: Any = ...,
|
||||
*,
|
||||
encoding: str | None = ...,
|
||||
errors: str | None = ...,
|
||||
) -> None: ...
|
||||
|
||||
def poll(self) -> int | None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def wait(self, timeout: float | None = ...) -> int: ...
|
||||
else:
|
||||
def wait(self, timeout: float | None = ..., endtime: float | None = ...) -> int: ...
|
||||
def wait(self, timeout: float | None = ...) -> int: ...
|
||||
# Return str/bytes
|
||||
def communicate(
|
||||
self,
|
||||
@@ -3019,27 +2585,35 @@ else:
|
||||
|
||||
if sys.platform == "win32":
|
||||
class STARTUPINFO:
|
||||
if sys.version_info >= (3, 7):
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
dwFlags: int = ...,
|
||||
hStdInput: Any | None = ...,
|
||||
hStdOutput: Any | None = ...,
|
||||
hStdError: Any | None = ...,
|
||||
wShowWindow: int = ...,
|
||||
lpAttributeList: Mapping[str, Any] | None = ...,
|
||||
) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
dwFlags: int = ...,
|
||||
hStdInput: Any | None = ...,
|
||||
hStdOutput: Any | None = ...,
|
||||
hStdError: Any | None = ...,
|
||||
wShowWindow: int = ...,
|
||||
lpAttributeList: Mapping[str, Any] | None = ...,
|
||||
) -> None: ...
|
||||
dwFlags: int
|
||||
hStdInput: Any | None
|
||||
hStdOutput: Any | None
|
||||
hStdError: Any | None
|
||||
wShowWindow: int
|
||||
if sys.version_info >= (3, 7):
|
||||
lpAttributeList: Mapping[str, Any]
|
||||
lpAttributeList: Mapping[str, Any]
|
||||
from _winapi import (
|
||||
ABOVE_NORMAL_PRIORITY_CLASS as ABOVE_NORMAL_PRIORITY_CLASS,
|
||||
BELOW_NORMAL_PRIORITY_CLASS as BELOW_NORMAL_PRIORITY_CLASS,
|
||||
CREATE_BREAKAWAY_FROM_JOB as CREATE_BREAKAWAY_FROM_JOB,
|
||||
CREATE_DEFAULT_ERROR_MODE as CREATE_DEFAULT_ERROR_MODE,
|
||||
CREATE_NEW_CONSOLE as CREATE_NEW_CONSOLE,
|
||||
CREATE_NEW_PROCESS_GROUP as CREATE_NEW_PROCESS_GROUP,
|
||||
CREATE_NO_WINDOW as CREATE_NO_WINDOW,
|
||||
DETACHED_PROCESS as DETACHED_PROCESS,
|
||||
HIGH_PRIORITY_CLASS as HIGH_PRIORITY_CLASS,
|
||||
IDLE_PRIORITY_CLASS as IDLE_PRIORITY_CLASS,
|
||||
NORMAL_PRIORITY_CLASS as NORMAL_PRIORITY_CLASS,
|
||||
REALTIME_PRIORITY_CLASS as REALTIME_PRIORITY_CLASS,
|
||||
STARTF_USESHOWWINDOW as STARTF_USESHOWWINDOW,
|
||||
STARTF_USESTDHANDLES as STARTF_USESTDHANDLES,
|
||||
STD_ERROR_HANDLE as STD_ERROR_HANDLE,
|
||||
@@ -3047,17 +2621,3 @@ if sys.platform == "win32":
|
||||
STD_OUTPUT_HANDLE as STD_OUTPUT_HANDLE,
|
||||
SW_HIDE as SW_HIDE,
|
||||
)
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from _winapi import (
|
||||
ABOVE_NORMAL_PRIORITY_CLASS as ABOVE_NORMAL_PRIORITY_CLASS,
|
||||
BELOW_NORMAL_PRIORITY_CLASS as BELOW_NORMAL_PRIORITY_CLASS,
|
||||
CREATE_BREAKAWAY_FROM_JOB as CREATE_BREAKAWAY_FROM_JOB,
|
||||
CREATE_DEFAULT_ERROR_MODE as CREATE_DEFAULT_ERROR_MODE,
|
||||
CREATE_NO_WINDOW as CREATE_NO_WINDOW,
|
||||
DETACHED_PROCESS as DETACHED_PROCESS,
|
||||
HIGH_PRIORITY_CLASS as HIGH_PRIORITY_CLASS,
|
||||
IDLE_PRIORITY_CLASS as IDLE_PRIORITY_CLASS,
|
||||
NORMAL_PRIORITY_CLASS as NORMAL_PRIORITY_CLASS,
|
||||
REALTIME_PRIORITY_CLASS as REALTIME_PRIORITY_CLASS,
|
||||
)
|
||||
|
||||
+1
-2
@@ -86,8 +86,7 @@ comp_if: int
|
||||
encoding_decl: int
|
||||
yield_expr: int
|
||||
yield_arg: int
|
||||
if sys.version_info >= (3, 7):
|
||||
sync_comp_for: int
|
||||
sync_comp_for: int
|
||||
if sys.version_info >= (3, 8):
|
||||
func_body_suite: int
|
||||
func_type: int
|
||||
|
||||
+10
-14
@@ -81,10 +81,8 @@ flags: _flags
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
_FlagTuple: TypeAlias = tuple[int, int, int, int, int, int, int, int, int, int, int, int, int, bool, int, int]
|
||||
elif sys.version_info >= (3, 7):
|
||||
_FlagTuple: TypeAlias = tuple[int, int, int, int, int, int, int, int, int, int, int, int, int, bool, int]
|
||||
else:
|
||||
_FlagTuple: TypeAlias = tuple[int, int, int, int, int, int, int, int, int, int, int, int, int]
|
||||
_FlagTuple: TypeAlias = tuple[int, int, int, int, int, int, int, int, int, int, int, int, int, bool, int]
|
||||
|
||||
@final
|
||||
class _flags(_UninstantiableStructseq, _FlagTuple):
|
||||
@@ -114,11 +112,10 @@ class _flags(_UninstantiableStructseq, _FlagTuple):
|
||||
def hash_randomization(self) -> int: ...
|
||||
@property
|
||||
def isolated(self) -> int: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
@property
|
||||
def dev_mode(self) -> bool: ...
|
||||
@property
|
||||
def utf8_mode(self) -> int: ...
|
||||
@property
|
||||
def dev_mode(self) -> bool: ...
|
||||
@property
|
||||
def utf8_mode(self) -> int: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
@property
|
||||
def warn_default_encoding(self) -> int: ... # undocumented
|
||||
@@ -276,9 +273,9 @@ if sys.platform == "win32":
|
||||
def intern(__string: str) -> str: ...
|
||||
def is_finalizing() -> bool: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__breakpointhook__: Any # contains the original value of breakpointhook
|
||||
def breakpointhook(*args: Any, **kwargs: Any) -> Any: ...
|
||||
__breakpointhook__: Any # contains the original value of breakpointhook
|
||||
|
||||
def breakpointhook(*args: Any, **kwargs: Any) -> Any: ...
|
||||
|
||||
if sys.platform != "win32":
|
||||
def setdlopenflags(__flags: int) -> None: ...
|
||||
@@ -323,9 +320,8 @@ def set_asyncgen_hooks(firstiter: _AsyncgenHook = ..., finalizer: _AsyncgenHook
|
||||
if sys.platform == "win32":
|
||||
def _enablelegacywindowsfsencoding() -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def get_coroutine_origin_tracking_depth() -> int: ...
|
||||
def set_coroutine_origin_tracking_depth(depth: int) -> None: ...
|
||||
def get_coroutine_origin_tracking_depth() -> int: ...
|
||||
def set_coroutine_origin_tracking_depth(depth: int) -> None: ...
|
||||
|
||||
if sys.version_info < (3, 8):
|
||||
_CoroWrapper: TypeAlias = Callable[[Coroutine[Any, Any, Any]], Any]
|
||||
|
||||
+8
-20
@@ -294,26 +294,14 @@ class TarFile:
|
||||
def chown(self, tarinfo: TarInfo, targetpath: StrOrBytesPath, numeric_owner: bool) -> None: ... # undocumented
|
||||
def chmod(self, tarinfo: TarInfo, targetpath: StrOrBytesPath) -> None: ... # undocumented
|
||||
def utime(self, tarinfo: TarInfo, targetpath: StrOrBytesPath) -> None: ... # undocumented
|
||||
if sys.version_info >= (3, 7):
|
||||
def add(
|
||||
self,
|
||||
name: StrPath,
|
||||
arcname: StrPath | None = ...,
|
||||
recursive: bool = ...,
|
||||
*,
|
||||
filter: Callable[[TarInfo], TarInfo | None] | None = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def add(
|
||||
self,
|
||||
name: StrPath,
|
||||
arcname: StrPath | None = ...,
|
||||
recursive: bool = ...,
|
||||
exclude: Callable[[str], bool] | None = ...,
|
||||
*,
|
||||
filter: Callable[[TarInfo], TarInfo | None] | None = ...,
|
||||
) -> None: ...
|
||||
|
||||
def add(
|
||||
self,
|
||||
name: StrPath,
|
||||
arcname: StrPath | None = ...,
|
||||
recursive: bool = ...,
|
||||
*,
|
||||
filter: Callable[[TarInfo], TarInfo | None] | None = ...,
|
||||
) -> None: ...
|
||||
def addfile(self, tarinfo: TarInfo, fileobj: IO[bytes] | None = ...) -> None: ...
|
||||
def gettarinfo(
|
||||
self, name: StrOrBytesPath | None = ..., arcname: str | None = ..., fileobj: IO[bytes] | None = ...
|
||||
|
||||
+16
-18
@@ -10,12 +10,11 @@ daylight: int
|
||||
timezone: int
|
||||
tzname: tuple[str, str]
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
if sys.platform == "linux":
|
||||
CLOCK_BOOTTIME: int
|
||||
if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin":
|
||||
CLOCK_PROF: int # FreeBSD, NetBSD, OpenBSD
|
||||
CLOCK_UPTIME: int # FreeBSD, OpenBSD
|
||||
if sys.platform == "linux":
|
||||
CLOCK_BOOTTIME: int
|
||||
if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin":
|
||||
CLOCK_PROF: int # FreeBSD, NetBSD, OpenBSD
|
||||
CLOCK_UPTIME: int # FreeBSD, OpenBSD
|
||||
|
||||
if sys.platform != "win32":
|
||||
CLOCK_MONOTONIC: int
|
||||
@@ -97,17 +96,16 @@ if sys.platform != "win32":
|
||||
def clock_gettime(clk_id: int) -> float: ... # Unix only
|
||||
def clock_settime(clk_id: int, time: float) -> None: ... # Unix only
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
if sys.platform != "win32":
|
||||
def clock_gettime_ns(clock_id: int) -> int: ...
|
||||
def clock_settime_ns(clock_id: int, time: int) -> int: ...
|
||||
if sys.platform != "win32":
|
||||
def clock_gettime_ns(clock_id: int) -> int: ...
|
||||
def clock_settime_ns(clock_id: int, time: int) -> int: ...
|
||||
|
||||
if sys.platform == "linux":
|
||||
def pthread_getcpuclockid(thread_id: int) -> int: ...
|
||||
if sys.platform == "linux":
|
||||
def pthread_getcpuclockid(thread_id: int) -> int: ...
|
||||
|
||||
def monotonic_ns() -> int: ...
|
||||
def perf_counter_ns() -> int: ...
|
||||
def process_time_ns() -> int: ...
|
||||
def time_ns() -> int: ...
|
||||
def thread_time() -> float: ...
|
||||
def thread_time_ns() -> int: ...
|
||||
def monotonic_ns() -> int: ...
|
||||
def perf_counter_ns() -> int: ...
|
||||
def process_time_ns() -> int: ...
|
||||
def time_ns() -> int: ...
|
||||
def thread_time() -> float: ...
|
||||
def thread_time_ns() -> int: ...
|
||||
|
||||
+65
-68
@@ -31,11 +31,9 @@ __all__ = [
|
||||
"OptionMenu",
|
||||
"tclobjs_to_py",
|
||||
"setup_master",
|
||||
"Spinbox",
|
||||
]
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ += ["Spinbox"]
|
||||
|
||||
def tclobjs_to_py(adict: dict[Any, Any]) -> dict[Any, Any]: ...
|
||||
def setup_master(master: Any | None = ...): ...
|
||||
|
||||
@@ -853,71 +851,70 @@ class Sizegrip(Widget):
|
||||
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
|
||||
config = configure
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
class Spinbox(Entry):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
*,
|
||||
background: tkinter._Color = ..., # undocumented
|
||||
class_: str = ...,
|
||||
command: Callable[[], Any] | str | list[str] | tuple[str, ...] = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
exportselection: bool = ..., # undocumented
|
||||
font: _FontDescription = ..., # undocumented
|
||||
foreground: tkinter._Color = ..., # undocumented
|
||||
format: str = ...,
|
||||
from_: float = ...,
|
||||
increment: float = ...,
|
||||
invalidcommand: tkinter._EntryValidateCommand = ..., # undocumented
|
||||
justify: Literal["left", "center", "right"] = ..., # undocumented
|
||||
name: str = ...,
|
||||
show: Any = ..., # undocumented
|
||||
state: str = ...,
|
||||
style: str = ...,
|
||||
takefocus: tkinter._TakeFocusValue = ...,
|
||||
textvariable: tkinter.Variable = ..., # undocumented
|
||||
to: float = ...,
|
||||
validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
|
||||
validatecommand: tkinter._EntryValidateCommand = ...,
|
||||
values: list[str] | tuple[str, ...] = ...,
|
||||
width: int = ..., # undocumented
|
||||
wrap: bool = ...,
|
||||
xscrollcommand: tkinter._XYScrollCommand = ...,
|
||||
) -> None: ...
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
*,
|
||||
background: tkinter._Color = ...,
|
||||
command: Callable[[], Any] | str | list[str] | tuple[str, ...] = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
exportselection: bool = ...,
|
||||
font: _FontDescription = ...,
|
||||
foreground: tkinter._Color = ...,
|
||||
format: str = ...,
|
||||
from_: float = ...,
|
||||
increment: float = ...,
|
||||
invalidcommand: tkinter._EntryValidateCommand = ...,
|
||||
justify: Literal["left", "center", "right"] = ...,
|
||||
show: Any = ...,
|
||||
state: str = ...,
|
||||
style: str = ...,
|
||||
takefocus: tkinter._TakeFocusValue = ...,
|
||||
textvariable: tkinter.Variable = ...,
|
||||
to: float = ...,
|
||||
validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
|
||||
validatecommand: tkinter._EntryValidateCommand = ...,
|
||||
values: list[str] | tuple[str, ...] = ...,
|
||||
width: int = ...,
|
||||
wrap: bool = ...,
|
||||
xscrollcommand: tkinter._XYScrollCommand = ...,
|
||||
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
|
||||
@overload
|
||||
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
|
||||
config = configure # type: ignore[assignment]
|
||||
def set(self, value: Any) -> None: ...
|
||||
class Spinbox(Entry):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
*,
|
||||
background: tkinter._Color = ..., # undocumented
|
||||
class_: str = ...,
|
||||
command: Callable[[], Any] | str | list[str] | tuple[str, ...] = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
exportselection: bool = ..., # undocumented
|
||||
font: _FontDescription = ..., # undocumented
|
||||
foreground: tkinter._Color = ..., # undocumented
|
||||
format: str = ...,
|
||||
from_: float = ...,
|
||||
increment: float = ...,
|
||||
invalidcommand: tkinter._EntryValidateCommand = ..., # undocumented
|
||||
justify: Literal["left", "center", "right"] = ..., # undocumented
|
||||
name: str = ...,
|
||||
show: Any = ..., # undocumented
|
||||
state: str = ...,
|
||||
style: str = ...,
|
||||
takefocus: tkinter._TakeFocusValue = ...,
|
||||
textvariable: tkinter.Variable = ..., # undocumented
|
||||
to: float = ...,
|
||||
validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
|
||||
validatecommand: tkinter._EntryValidateCommand = ...,
|
||||
values: list[str] | tuple[str, ...] = ...,
|
||||
width: int = ..., # undocumented
|
||||
wrap: bool = ...,
|
||||
xscrollcommand: tkinter._XYScrollCommand = ...,
|
||||
) -> None: ...
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
*,
|
||||
background: tkinter._Color = ...,
|
||||
command: Callable[[], Any] | str | list[str] | tuple[str, ...] = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
exportselection: bool = ...,
|
||||
font: _FontDescription = ...,
|
||||
foreground: tkinter._Color = ...,
|
||||
format: str = ...,
|
||||
from_: float = ...,
|
||||
increment: float = ...,
|
||||
invalidcommand: tkinter._EntryValidateCommand = ...,
|
||||
justify: Literal["left", "center", "right"] = ...,
|
||||
show: Any = ...,
|
||||
state: str = ...,
|
||||
style: str = ...,
|
||||
takefocus: tkinter._TakeFocusValue = ...,
|
||||
textvariable: tkinter.Variable = ...,
|
||||
to: float = ...,
|
||||
validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ...,
|
||||
validatecommand: tkinter._EntryValidateCommand = ...,
|
||||
values: list[str] | tuple[str, ...] = ...,
|
||||
width: int = ...,
|
||||
wrap: bool = ...,
|
||||
xscrollcommand: tkinter._XYScrollCommand = ...,
|
||||
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
|
||||
@overload
|
||||
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
|
||||
config = configure # type: ignore[assignment]
|
||||
def set(self, value: Any) -> None: ...
|
||||
|
||||
class _TreeviewItemDict(TypedDict):
|
||||
text: str
|
||||
|
||||
+8
-13
@@ -62,16 +62,13 @@ __all__ = [
|
||||
"VBAR",
|
||||
"VBAREQUAL",
|
||||
"tok_name",
|
||||
"ENCODING",
|
||||
"NL",
|
||||
"COMMENT",
|
||||
]
|
||||
|
||||
if sys.version_info < (3, 7) or sys.version_info >= (3, 8):
|
||||
__all__ += ["ASYNC", "AWAIT"]
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ += ["ENCODING", "NL", "COMMENT"]
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
__all__ += ["COLONEQUAL", "TYPE_COMMENT", "TYPE_IGNORE"]
|
||||
__all__ += ["ASYNC", "AWAIT", "COLONEQUAL", "TYPE_COMMENT", "TYPE_IGNORE"]
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
__all__ += ["SOFT_KEYWORD"]
|
||||
@@ -129,8 +126,7 @@ AT: int
|
||||
RARROW: int
|
||||
ELLIPSIS: int
|
||||
ATEQUAL: int
|
||||
if sys.version_info < (3, 7) or sys.version_info >= (3, 8):
|
||||
# These were removed in Python 3.7 but added back in Python 3.8
|
||||
if sys.version_info >= (3, 8):
|
||||
AWAIT: int
|
||||
ASYNC: int
|
||||
OP: int
|
||||
@@ -138,10 +134,9 @@ ERRORTOKEN: int
|
||||
N_TOKENS: int
|
||||
NT_OFFSET: int
|
||||
tok_name: dict[int, str]
|
||||
if sys.version_info >= (3, 7):
|
||||
COMMENT: int
|
||||
NL: int
|
||||
ENCODING: int
|
||||
COMMENT: int
|
||||
NL: int
|
||||
ENCODING: int
|
||||
if sys.version_info >= (3, 8):
|
||||
TYPE_COMMENT: int
|
||||
TYPE_IGNORE: int
|
||||
|
||||
+1
-13
@@ -77,11 +77,8 @@ __all__ = [
|
||||
"untokenize",
|
||||
]
|
||||
|
||||
if sys.version_info < (3, 7) or sys.version_info >= (3, 8):
|
||||
__all__ += ["ASYNC", "AWAIT"]
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
__all__ += ["COLONEQUAL", "generate_tokens", "TYPE_COMMENT", "TYPE_IGNORE"]
|
||||
__all__ += ["ASYNC", "AWAIT", "COLONEQUAL", "generate_tokens", "TYPE_COMMENT", "TYPE_IGNORE"]
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
__all__ += ["SOFT_KEYWORD"]
|
||||
@@ -91,11 +88,6 @@ if sys.version_info >= (3, 8):
|
||||
else:
|
||||
EXACT_TOKEN_TYPES: dict[str, int]
|
||||
|
||||
if sys.version_info < (3, 7):
|
||||
COMMENT: int
|
||||
NL: int
|
||||
ENCODING: int
|
||||
|
||||
cookie_re: Pattern[str]
|
||||
blank_re: Pattern[bytes]
|
||||
|
||||
@@ -167,10 +159,6 @@ Double3: str # undocumented
|
||||
Triple: str # undocumented
|
||||
String: str # undocumented
|
||||
|
||||
if sys.version_info < (3, 7):
|
||||
Operator: str # undocumented
|
||||
Bracket: str # undocumented
|
||||
|
||||
Special: str # undocumented
|
||||
Funny: str # undocumented
|
||||
|
||||
|
||||
@@ -83,11 +83,8 @@ class Traceback(Sequence[Frame]):
|
||||
def __init__(self, frames: Sequence[_FrameTuple], total_nframe: int | None = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self, frames: Sequence[_FrameTuple]) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def format(self, limit: int | None = ..., most_recent_first: bool = ...) -> list[str]: ...
|
||||
else:
|
||||
def format(self, limit: int | None = ...) -> list[str]: ...
|
||||
|
||||
def format(self, limit: int | None = ..., most_recent_first: bool = ...) -> list[str]: ...
|
||||
@overload
|
||||
def __getitem__(self, index: SupportsIndex) -> Frame: ...
|
||||
@overload
|
||||
|
||||
+61
-82
@@ -41,17 +41,13 @@ __all__ = [
|
||||
"DynamicClassAttribute",
|
||||
"coroutine",
|
||||
"BuiltinMethodType",
|
||||
"ClassMethodDescriptorType",
|
||||
"MethodDescriptorType",
|
||||
"MethodWrapperType",
|
||||
"WrapperDescriptorType",
|
||||
"resolve_bases",
|
||||
]
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ += [
|
||||
"ClassMethodDescriptorType",
|
||||
"MethodDescriptorType",
|
||||
"MethodWrapperType",
|
||||
"WrapperDescriptorType",
|
||||
"resolve_bases",
|
||||
]
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
__all__ += ["CellType"]
|
||||
|
||||
@@ -407,9 +403,8 @@ class CoroutineType(Coroutine[_T_co, _T_contra, _V_co]):
|
||||
def cr_frame(self) -> FrameType: ...
|
||||
@property
|
||||
def cr_running(self) -> bool: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
@property
|
||||
def cr_origin(self) -> tuple[tuple[str, int, str], ...] | None: ...
|
||||
@property
|
||||
def cr_origin(self) -> tuple[tuple[str, int, str], ...] | None: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
@property
|
||||
def cr_suspended(self) -> bool: ...
|
||||
@@ -465,62 +460,57 @@ class BuiltinFunctionType:
|
||||
|
||||
BuiltinMethodType = BuiltinFunctionType
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
@final
|
||||
class WrapperDescriptorType:
|
||||
@property
|
||||
def __name__(self) -> str: ...
|
||||
@property
|
||||
def __qualname__(self) -> str: ...
|
||||
@property
|
||||
def __objclass__(self) -> type: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def __get__(self, __obj: Any, __type: type = ...) -> Any: ...
|
||||
@final
|
||||
class WrapperDescriptorType:
|
||||
@property
|
||||
def __name__(self) -> str: ...
|
||||
@property
|
||||
def __qualname__(self) -> str: ...
|
||||
@property
|
||||
def __objclass__(self) -> type: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def __get__(self, __obj: Any, __type: type = ...) -> Any: ...
|
||||
|
||||
@final
|
||||
class MethodWrapperType:
|
||||
@property
|
||||
def __self__(self) -> object: ...
|
||||
@property
|
||||
def __name__(self) -> str: ...
|
||||
@property
|
||||
def __qualname__(self) -> str: ...
|
||||
@property
|
||||
def __objclass__(self) -> type: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def __eq__(self, __other: object) -> bool: ...
|
||||
def __ne__(self, __other: object) -> bool: ...
|
||||
@final
|
||||
class MethodWrapperType:
|
||||
@property
|
||||
def __self__(self) -> object: ...
|
||||
@property
|
||||
def __name__(self) -> str: ...
|
||||
@property
|
||||
def __qualname__(self) -> str: ...
|
||||
@property
|
||||
def __objclass__(self) -> type: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def __eq__(self, __other: object) -> bool: ...
|
||||
def __ne__(self, __other: object) -> bool: ...
|
||||
|
||||
@final
|
||||
class MethodDescriptorType:
|
||||
@property
|
||||
def __name__(self) -> str: ...
|
||||
@property
|
||||
def __qualname__(self) -> str: ...
|
||||
@property
|
||||
def __objclass__(self) -> type: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def __get__(self, obj: Any, type: type = ...) -> Any: ...
|
||||
@final
|
||||
class MethodDescriptorType:
|
||||
@property
|
||||
def __name__(self) -> str: ...
|
||||
@property
|
||||
def __qualname__(self) -> str: ...
|
||||
@property
|
||||
def __objclass__(self) -> type: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def __get__(self, obj: Any, type: type = ...) -> Any: ...
|
||||
|
||||
@final
|
||||
class ClassMethodDescriptorType:
|
||||
@property
|
||||
def __name__(self) -> str: ...
|
||||
@property
|
||||
def __qualname__(self) -> str: ...
|
||||
@property
|
||||
def __objclass__(self) -> type: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def __get__(self, obj: Any, type: type = ...) -> Any: ...
|
||||
@final
|
||||
class ClassMethodDescriptorType:
|
||||
@property
|
||||
def __name__(self) -> str: ...
|
||||
@property
|
||||
def __qualname__(self) -> str: ...
|
||||
@property
|
||||
def __objclass__(self) -> type: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def __get__(self, obj: Any, type: type = ...) -> Any: ...
|
||||
|
||||
@final
|
||||
class TracebackType:
|
||||
if sys.version_info >= (3, 7):
|
||||
def __init__(self, tb_next: TracebackType | None, tb_frame: FrameType, tb_lasti: int, tb_lineno: int) -> None: ...
|
||||
tb_next: TracebackType | None
|
||||
else:
|
||||
@property
|
||||
def tb_next(self) -> TracebackType | None: ...
|
||||
def __init__(self, tb_next: TracebackType | None, tb_frame: FrameType, tb_lasti: int, tb_lineno: int) -> None: ...
|
||||
tb_next: TracebackType | None
|
||||
# the rest are read-only even in 3.7
|
||||
@property
|
||||
def tb_frame(self) -> FrameType: ...
|
||||
@@ -549,9 +539,8 @@ class FrameType:
|
||||
@property
|
||||
def f_locals(self) -> dict[str, Any]: ...
|
||||
f_trace: Callable[[FrameType, str, Any], Any] | None
|
||||
if sys.version_info >= (3, 7):
|
||||
f_trace_lines: bool
|
||||
f_trace_opcodes: bool
|
||||
f_trace_lines: bool
|
||||
f_trace_opcodes: bool
|
||||
def clear(self) -> None: ...
|
||||
|
||||
@final
|
||||
@@ -578,23 +567,13 @@ class MemberDescriptorType:
|
||||
def __set__(self, __instance: Any, __value: Any) -> None: ...
|
||||
def __delete__(self, __obj: Any) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def new_class(
|
||||
name: str,
|
||||
bases: Iterable[object] = ...,
|
||||
kwds: dict[str, Any] | None = ...,
|
||||
exec_body: Callable[[dict[str, Any]], object] | None = ...,
|
||||
) -> type: ...
|
||||
def resolve_bases(bases: Iterable[object]) -> tuple[Any, ...]: ...
|
||||
|
||||
else:
|
||||
def new_class(
|
||||
name: str,
|
||||
bases: tuple[type, ...] = ...,
|
||||
kwds: dict[str, Any] | None = ...,
|
||||
exec_body: Callable[[dict[str, Any]], object] | None = ...,
|
||||
) -> type: ...
|
||||
|
||||
def new_class(
|
||||
name: str,
|
||||
bases: Iterable[object] = ...,
|
||||
kwds: dict[str, Any] | None = ...,
|
||||
exec_body: Callable[[dict[str, Any]], object] | None = ...,
|
||||
) -> type: ...
|
||||
def resolve_bases(bases: Iterable[object]) -> tuple[Any, ...]: ...
|
||||
def prepare_class(
|
||||
name: str, bases: tuple[type, ...] = ..., kwds: dict[str, Any] | None = ...
|
||||
) -> tuple[type, dict[str, Any], dict[str, Any]]: ...
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user