mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 14:21:24 +00:00
Sync vendored typeshed stubs (#12325)
Close and reopen this PR to trigger CI Co-authored-by: typeshedbot <>
This commit is contained in:
parent
2348714081
commit
b9a8cd390f
54 changed files with 921 additions and 250 deletions
|
@ -1 +1 @@
|
|||
dcab6e88883c629ede9637fb011958f8b4918f52
|
||||
f863db6bc5242348ceaa6a3bca4e59aa9e62faaa
|
||||
|
|
|
@ -35,6 +35,8 @@ _dummy_threading: 3.0-3.8
|
|||
_heapq: 3.0-
|
||||
_imp: 3.0-
|
||||
_interpchannels: 3.13-
|
||||
_interpqueues: 3.13-
|
||||
_interpreters: 3.13-
|
||||
_json: 3.0-
|
||||
_locale: 3.0-
|
||||
_lsprof: 3.0-
|
||||
|
@ -112,6 +114,7 @@ curses: 3.0-
|
|||
dataclasses: 3.7-
|
||||
datetime: 3.0-
|
||||
dbm: 3.0-
|
||||
dbm.sqlite3: 3.13-
|
||||
decimal: 3.0-
|
||||
difflib: 3.0-
|
||||
dis: 3.0-
|
||||
|
@ -155,6 +158,7 @@ importlib: 3.0-
|
|||
importlib._abc: 3.10-
|
||||
importlib.metadata: 3.8-
|
||||
importlib.metadata._meta: 3.10-
|
||||
importlib.metadata.diagnose: 3.13-
|
||||
importlib.readers: 3.10-
|
||||
importlib.resources: 3.7-
|
||||
importlib.resources.abc: 3.11-
|
||||
|
|
|
@ -70,6 +70,8 @@ _VT_co = TypeVar("_VT_co", covariant=True) # Value type covariant containers.
|
|||
@final
|
||||
class dict_keys(KeysView[_KT_co], Generic[_KT_co, _VT_co]): # undocumented
|
||||
def __eq__(self, value: object, /) -> bool: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def isdisjoint(self, other: Iterable[_KT_co], /) -> bool: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
@property
|
||||
def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ...
|
||||
|
@ -83,6 +85,8 @@ class dict_values(ValuesView[_VT_co], Generic[_KT_co, _VT_co]): # undocumented
|
|||
@final
|
||||
class dict_items(ItemsView[_KT_co, _VT_co]): # undocumented
|
||||
def __eq__(self, value: object, /) -> bool: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def isdisjoint(self, other: Iterable[tuple[_KT_co, _VT_co]], /) -> bool: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
@property
|
||||
def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ...
|
||||
|
|
|
@ -64,7 +64,6 @@ class _CData(metaclass=_CDataMeta):
|
|||
# Structure.from_buffer(...) # valid at runtime
|
||||
# Structure(...).from_buffer(...) # invalid at runtime
|
||||
#
|
||||
|
||||
@classmethod
|
||||
def from_buffer(cls, source: WriteableBuffer, offset: int = ...) -> Self: ...
|
||||
@classmethod
|
||||
|
@ -100,8 +99,8 @@ class _Pointer(_PointerLike, _CData, Generic[_CT]):
|
|||
def __getitem__(self, key: slice, /) -> list[Any]: ...
|
||||
def __setitem__(self, key: int, value: Any, /) -> None: ...
|
||||
|
||||
def POINTER(type: type[_CT]) -> type[_Pointer[_CT]]: ...
|
||||
def pointer(arg: _CT, /) -> _Pointer[_CT]: ...
|
||||
def POINTER(type: type[_CT], /) -> type[_Pointer[_CT]]: ...
|
||||
def pointer(obj: _CT, /) -> _Pointer[_CT]: ...
|
||||
|
||||
class _CArgObject: ...
|
||||
|
||||
|
@ -203,9 +202,9 @@ class Array(_CData, Generic[_CT]):
|
|||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
|
||||
|
||||
def addressof(obj: _CData) -> int: ...
|
||||
def alignment(obj_or_type: _CData | type[_CData]) -> int: ...
|
||||
def addressof(obj: _CData, /) -> int: ...
|
||||
def alignment(obj_or_type: _CData | type[_CData], /) -> int: ...
|
||||
def get_errno() -> int: ...
|
||||
def resize(obj: _CData, size: int) -> None: ...
|
||||
def set_errno(value: int) -> int: ...
|
||||
def sizeof(obj_or_type: _CData | type[_CData]) -> int: ...
|
||||
def resize(obj: _CData, size: int, /) -> None: ...
|
||||
def set_errno(value: int, /) -> int: ...
|
||||
def sizeof(obj_or_type: _CData | type[_CData], /) -> int: ...
|
||||
|
|
16
crates/red_knot_module_resolver/vendor/typeshed/stdlib/_interpqueues.pyi
vendored
Normal file
16
crates/red_knot_module_resolver/vendor/typeshed/stdlib/_interpqueues.pyi
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
from typing import Any, SupportsIndex
|
||||
|
||||
class QueueError(RuntimeError): ...
|
||||
class QueueNotFoundError(QueueError): ...
|
||||
|
||||
def bind(qid: SupportsIndex) -> None: ...
|
||||
def create(maxsize: SupportsIndex, fmt: SupportsIndex) -> int: ...
|
||||
def destroy(qid: SupportsIndex) -> None: ...
|
||||
def get(qid: SupportsIndex) -> tuple[Any, int]: ...
|
||||
def get_count(qid: SupportsIndex) -> int: ...
|
||||
def get_maxsize(qid: SupportsIndex) -> int: ...
|
||||
def get_queue_defaults(qid: SupportsIndex) -> tuple[int]: ...
|
||||
def is_full(qid: SupportsIndex) -> bool: ...
|
||||
def list_all() -> list[tuple[int, int]]: ...
|
||||
def put(qid: SupportsIndex, obj: Any, fmt: SupportsIndex) -> None: ...
|
||||
def release(qid: SupportsIndex) -> None: ...
|
50
crates/red_knot_module_resolver/vendor/typeshed/stdlib/_interpreters.pyi
vendored
Normal file
50
crates/red_knot_module_resolver/vendor/typeshed/stdlib/_interpreters.pyi
vendored
Normal file
|
@ -0,0 +1,50 @@
|
|||
import types
|
||||
from collections.abc import Callable, Mapping
|
||||
from typing import Final, Literal, SupportsIndex
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
_Configs: TypeAlias = Literal["default", "isolated", "legacy", "empty", ""]
|
||||
|
||||
class InterpreterError(Exception): ...
|
||||
class InterpreterNotFoundError(InterpreterError): ...
|
||||
class NotShareableError(Exception): ...
|
||||
|
||||
class CrossInterpreterBufferView:
|
||||
def __buffer__(self, flags: int, /) -> memoryview: ...
|
||||
|
||||
def new_config(name: _Configs = "isolated", /, **overides: object) -> types.SimpleNamespace: ...
|
||||
def create(config: types.SimpleNamespace | _Configs | None = "isolated", *, reqrefs: bool = False) -> int: ...
|
||||
def destroy(id: SupportsIndex, *, restrict: bool = False) -> None: ...
|
||||
def list_all(*, require_ready: bool) -> list[tuple[int, int]]: ...
|
||||
def get_current() -> tuple[int, int]: ...
|
||||
def get_main() -> tuple[int, int]: ...
|
||||
def is_running(id: SupportsIndex, *, restrict: bool = False) -> bool: ...
|
||||
def get_config(id: SupportsIndex, *, restrict: bool = False) -> types.SimpleNamespace: ...
|
||||
def whence(id: SupportsIndex) -> int: ...
|
||||
def exec(id: SupportsIndex, code: str, shared: bool | None = None, *, restrict: bool = False) -> None: ...
|
||||
def call(
|
||||
id: SupportsIndex,
|
||||
callable: Callable[..., object],
|
||||
args: tuple[object, ...] | None = None,
|
||||
kwargs: dict[str, object] | None = None,
|
||||
*,
|
||||
restrict: bool = False,
|
||||
) -> object: ...
|
||||
def run_string(
|
||||
id: SupportsIndex, script: str | types.CodeType | Callable[[], object], shared: bool | None = None, *, restrict: bool = False
|
||||
) -> None: ...
|
||||
def run_func(
|
||||
id: SupportsIndex, func: types.CodeType | Callable[[], object], shared: bool | None = None, *, restrict: bool = False
|
||||
) -> None: ...
|
||||
def set___main___attrs(id: SupportsIndex, updates: Mapping[str, object], *, restrict: bool = False) -> None: ...
|
||||
def incref(id: SupportsIndex, *, implieslink: bool = False, restrict: bool = False) -> None: ...
|
||||
def decref(id: SupportsIndex, *, restrict: bool = False) -> None: ...
|
||||
def is_shareable(obj: object) -> bool: ...
|
||||
def capture_exception(exc: BaseException | None = None) -> types.SimpleNamespace: ...
|
||||
|
||||
WHENCE_UNKNOWN: Final = 0
|
||||
WHENCE_RUNTIME: Final = 1
|
||||
WHENCE_LEGACY_CAPI: Final = 2
|
||||
WHENCE_CAPI: Final = 3
|
||||
WHENCE_XI: Final = 4
|
||||
WHENCE_STDLIB: Final = 5
|
|
@ -13,7 +13,7 @@ error = RuntimeError
|
|||
def _count() -> int: ...
|
||||
@final
|
||||
class LockType:
|
||||
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
|
||||
def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ...
|
||||
def release(self) -> None: ...
|
||||
def locked(self) -> bool: ...
|
||||
def __enter__(self) -> bool: ...
|
||||
|
@ -22,14 +22,14 @@ class LockType:
|
|||
) -> None: ...
|
||||
|
||||
@overload
|
||||
def start_new_thread(function: Callable[[Unpack[_Ts]], object], args: tuple[Unpack[_Ts]]) -> int: ...
|
||||
def start_new_thread(function: Callable[[Unpack[_Ts]], object], args: tuple[Unpack[_Ts]], /) -> int: ...
|
||||
@overload
|
||||
def start_new_thread(function: Callable[..., object], args: tuple[Any, ...], kwargs: dict[str, Any]) -> int: ...
|
||||
def start_new_thread(function: Callable[..., object], args: tuple[Any, ...], kwargs: dict[str, Any], /) -> int: ...
|
||||
def interrupt_main() -> None: ...
|
||||
def exit() -> NoReturn: ...
|
||||
def allocate_lock() -> LockType: ...
|
||||
def get_ident() -> int: ...
|
||||
def stack_size(size: int = ...) -> int: ...
|
||||
def stack_size(size: int = 0, /) -> int: ...
|
||||
|
||||
TIMEOUT_MAX: float
|
||||
|
||||
|
|
|
@ -28,17 +28,17 @@ class ABCMeta(type):
|
|||
def register(cls: ABCMeta, subclass: type[_T]) -> type[_T]: ...
|
||||
|
||||
def abstractmethod(funcobj: _FuncT) -> _FuncT: ...
|
||||
@deprecated("Deprecated, use 'classmethod' with 'abstractmethod' instead")
|
||||
@deprecated("Use 'classmethod' with 'abstractmethod' instead")
|
||||
class abstractclassmethod(classmethod[_T, _P, _R_co]):
|
||||
__isabstractmethod__: Literal[True]
|
||||
def __init__(self, callable: Callable[Concatenate[type[_T], _P], _R_co]) -> None: ...
|
||||
|
||||
@deprecated("Deprecated, use 'staticmethod' with 'abstractmethod' instead")
|
||||
@deprecated("Use 'staticmethod' with 'abstractmethod' instead")
|
||||
class abstractstaticmethod(staticmethod[_P, _R_co]):
|
||||
__isabstractmethod__: Literal[True]
|
||||
def __init__(self, callable: Callable[_P, _R_co]) -> None: ...
|
||||
|
||||
@deprecated("Deprecated, use 'property' with 'abstractmethod' instead")
|
||||
@deprecated("Use 'property' with 'abstractmethod' instead")
|
||||
class abstractproperty(property):
|
||||
__isabstractmethod__: Literal[True]
|
||||
|
||||
|
|
|
@ -49,6 +49,10 @@ class Server(AbstractServer):
|
|||
ssl_handshake_timeout: float | None,
|
||||
) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
def close_clients(self) -> None: ...
|
||||
def abort_clients(self) -> None: ...
|
||||
|
||||
def get_loop(self) -> AbstractEventLoop: ...
|
||||
def is_serving(self) -> bool: ...
|
||||
async def start_serving(self) -> None: ...
|
||||
|
@ -222,7 +226,48 @@ class BaseEventLoop(AbstractEventLoop):
|
|||
happy_eyeballs_delay: float | None = None,
|
||||
interleave: int | None = None,
|
||||
) -> tuple[Transport, _ProtocolT]: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
# 3.13 added `keep_alive`.
|
||||
@overload
|
||||
async def create_server(
|
||||
self,
|
||||
protocol_factory: _ProtocolFactory,
|
||||
host: str | Sequence[str] | None = None,
|
||||
port: int = ...,
|
||||
*,
|
||||
family: int = ...,
|
||||
flags: int = ...,
|
||||
sock: None = None,
|
||||
backlog: int = 100,
|
||||
ssl: _SSLContext = None,
|
||||
reuse_address: bool | None = None,
|
||||
reuse_port: bool | None = None,
|
||||
keep_alive: bool | None = None,
|
||||
ssl_handshake_timeout: float | None = None,
|
||||
ssl_shutdown_timeout: float | None = None,
|
||||
start_serving: bool = True,
|
||||
) -> Server: ...
|
||||
@overload
|
||||
async def create_server(
|
||||
self,
|
||||
protocol_factory: _ProtocolFactory,
|
||||
host: None = None,
|
||||
port: None = None,
|
||||
*,
|
||||
family: int = ...,
|
||||
flags: int = ...,
|
||||
sock: socket = ...,
|
||||
backlog: int = 100,
|
||||
ssl: _SSLContext = None,
|
||||
reuse_address: bool | None = None,
|
||||
reuse_port: bool | None = None,
|
||||
keep_alive: bool | None = None,
|
||||
ssl_handshake_timeout: float | None = None,
|
||||
ssl_shutdown_timeout: float | None = None,
|
||||
start_serving: bool = True,
|
||||
) -> Server: ...
|
||||
elif sys.version_info >= (3, 11):
|
||||
@overload
|
||||
async def create_server(
|
||||
self,
|
||||
|
@ -259,26 +304,6 @@ class BaseEventLoop(AbstractEventLoop):
|
|||
ssl_shutdown_timeout: float | None = None,
|
||||
start_serving: bool = True,
|
||||
) -> Server: ...
|
||||
async def start_tls(
|
||||
self,
|
||||
transport: BaseTransport,
|
||||
protocol: BaseProtocol,
|
||||
sslcontext: ssl.SSLContext,
|
||||
*,
|
||||
server_side: bool = False,
|
||||
server_hostname: str | None = None,
|
||||
ssl_handshake_timeout: float | None = None,
|
||||
ssl_shutdown_timeout: float | None = None,
|
||||
) -> Transport | None: ...
|
||||
async def connect_accepted_socket(
|
||||
self,
|
||||
protocol_factory: Callable[[], _ProtocolT],
|
||||
sock: socket,
|
||||
*,
|
||||
ssl: _SSLContext = None,
|
||||
ssl_handshake_timeout: float | None = None,
|
||||
ssl_shutdown_timeout: float | None = None,
|
||||
) -> tuple[Transport, _ProtocolT]: ...
|
||||
else:
|
||||
@overload
|
||||
async def create_server(
|
||||
|
@ -314,6 +339,29 @@ class BaseEventLoop(AbstractEventLoop):
|
|||
ssl_handshake_timeout: float | None = None,
|
||||
start_serving: bool = True,
|
||||
) -> Server: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
async def start_tls(
|
||||
self,
|
||||
transport: BaseTransport,
|
||||
protocol: BaseProtocol,
|
||||
sslcontext: ssl.SSLContext,
|
||||
*,
|
||||
server_side: bool = False,
|
||||
server_hostname: str | None = None,
|
||||
ssl_handshake_timeout: float | None = None,
|
||||
ssl_shutdown_timeout: float | None = None,
|
||||
) -> Transport | None: ...
|
||||
async def connect_accepted_socket(
|
||||
self,
|
||||
protocol_factory: Callable[[], _ProtocolT],
|
||||
sock: socket,
|
||||
*,
|
||||
ssl: _SSLContext = None,
|
||||
ssl_handshake_timeout: float | None = None,
|
||||
ssl_shutdown_timeout: float | None = None,
|
||||
) -> tuple[Transport, _ProtocolT]: ...
|
||||
else:
|
||||
async def start_tls(
|
||||
self,
|
||||
transport: BaseTransport,
|
||||
|
|
|
@ -94,6 +94,12 @@ class TimerHandle(Handle):
|
|||
class AbstractServer:
|
||||
@abstractmethod
|
||||
def close(self) -> None: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
@abstractmethod
|
||||
def close_clients(self) -> None: ...
|
||||
@abstractmethod
|
||||
def abort_clients(self) -> None: ...
|
||||
|
||||
async def __aenter__(self) -> Self: ...
|
||||
async def __aexit__(self, *exc: Unused) -> None: ...
|
||||
@abstractmethod
|
||||
|
@ -272,7 +278,50 @@ class AbstractEventLoop:
|
|||
happy_eyeballs_delay: float | None = None,
|
||||
interleave: int | None = None,
|
||||
) -> tuple[Transport, _ProtocolT]: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
# 3.13 added `keep_alive`.
|
||||
@overload
|
||||
@abstractmethod
|
||||
async def create_server(
|
||||
self,
|
||||
protocol_factory: _ProtocolFactory,
|
||||
host: str | Sequence[str] | None = None,
|
||||
port: int = ...,
|
||||
*,
|
||||
family: int = ...,
|
||||
flags: int = ...,
|
||||
sock: None = None,
|
||||
backlog: int = 100,
|
||||
ssl: _SSLContext = None,
|
||||
reuse_address: bool | None = None,
|
||||
reuse_port: bool | None = None,
|
||||
keep_alive: bool | None = None,
|
||||
ssl_handshake_timeout: float | None = None,
|
||||
ssl_shutdown_timeout: float | None = None,
|
||||
start_serving: bool = True,
|
||||
) -> Server: ...
|
||||
@overload
|
||||
@abstractmethod
|
||||
async def create_server(
|
||||
self,
|
||||
protocol_factory: _ProtocolFactory,
|
||||
host: None = None,
|
||||
port: None = None,
|
||||
*,
|
||||
family: int = ...,
|
||||
flags: int = ...,
|
||||
sock: socket = ...,
|
||||
backlog: int = 100,
|
||||
ssl: _SSLContext = None,
|
||||
reuse_address: bool | None = None,
|
||||
reuse_port: bool | None = None,
|
||||
keep_alive: bool | None = None,
|
||||
ssl_handshake_timeout: float | None = None,
|
||||
ssl_shutdown_timeout: float | None = None,
|
||||
start_serving: bool = True,
|
||||
) -> Server: ...
|
||||
elif sys.version_info >= (3, 11):
|
||||
@overload
|
||||
@abstractmethod
|
||||
async def create_server(
|
||||
|
@ -311,30 +360,6 @@ class AbstractEventLoop:
|
|||
ssl_shutdown_timeout: float | None = None,
|
||||
start_serving: bool = True,
|
||||
) -> Server: ...
|
||||
@abstractmethod
|
||||
async def start_tls(
|
||||
self,
|
||||
transport: WriteTransport,
|
||||
protocol: BaseProtocol,
|
||||
sslcontext: ssl.SSLContext,
|
||||
*,
|
||||
server_side: bool = False,
|
||||
server_hostname: str | None = None,
|
||||
ssl_handshake_timeout: float | None = None,
|
||||
ssl_shutdown_timeout: float | None = None,
|
||||
) -> Transport | None: ...
|
||||
async def create_unix_server(
|
||||
self,
|
||||
protocol_factory: _ProtocolFactory,
|
||||
path: StrPath | None = None,
|
||||
*,
|
||||
sock: socket | None = None,
|
||||
backlog: int = 100,
|
||||
ssl: _SSLContext = None,
|
||||
ssl_handshake_timeout: float | None = None,
|
||||
ssl_shutdown_timeout: float | None = None,
|
||||
start_serving: bool = True,
|
||||
) -> Server: ...
|
||||
else:
|
||||
@overload
|
||||
@abstractmethod
|
||||
|
@ -372,6 +397,33 @@ class AbstractEventLoop:
|
|||
ssl_handshake_timeout: float | None = None,
|
||||
start_serving: bool = True,
|
||||
) -> Server: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
@abstractmethod
|
||||
async def start_tls(
|
||||
self,
|
||||
transport: WriteTransport,
|
||||
protocol: BaseProtocol,
|
||||
sslcontext: ssl.SSLContext,
|
||||
*,
|
||||
server_side: bool = False,
|
||||
server_hostname: str | None = None,
|
||||
ssl_handshake_timeout: float | None = None,
|
||||
ssl_shutdown_timeout: float | None = None,
|
||||
) -> Transport | None: ...
|
||||
async def create_unix_server(
|
||||
self,
|
||||
protocol_factory: _ProtocolFactory,
|
||||
path: StrPath | None = None,
|
||||
*,
|
||||
sock: socket | None = None,
|
||||
backlog: int = 100,
|
||||
ssl: _SSLContext = None,
|
||||
ssl_handshake_timeout: float | None = None,
|
||||
ssl_shutdown_timeout: float | None = None,
|
||||
start_serving: bool = True,
|
||||
) -> Server: ...
|
||||
else:
|
||||
@abstractmethod
|
||||
async def start_tls(
|
||||
self,
|
||||
|
@ -394,6 +446,7 @@ class AbstractEventLoop:
|
|||
ssl_handshake_timeout: float | None = None,
|
||||
start_serving: bool = True,
|
||||
) -> Server: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
async def connect_accepted_socket(
|
||||
self,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import functools
|
||||
import sys
|
||||
import traceback
|
||||
from collections.abc import Iterable
|
||||
from types import FrameType, FunctionType
|
||||
|
@ -14,7 +15,17 @@ _FuncType: TypeAlias = FunctionType | _HasWrapper | functools.partial[Any] | fun
|
|||
def _get_function_source(func: _FuncType) -> tuple[str, int]: ...
|
||||
@overload
|
||||
def _get_function_source(func: object) -> tuple[str, int] | None: ...
|
||||
def _format_callback_source(func: object, args: Iterable[Any]) -> str: ...
|
||||
def _format_args_and_kwargs(args: Iterable[Any], kwargs: dict[str, Any]) -> str: ...
|
||||
def _format_callback(func: object, args: Iterable[Any], kwargs: dict[str, Any], suffix: str = "") -> str: ...
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
def _format_callback_source(func: object, args: Iterable[Any], *, debug: bool = False) -> str: ...
|
||||
def _format_args_and_kwargs(args: Iterable[Any], kwargs: dict[str, Any], *, debug: bool = False) -> str: ...
|
||||
def _format_callback(
|
||||
func: object, args: Iterable[Any], kwargs: dict[str, Any], *, debug: bool = False, suffix: str = ""
|
||||
) -> str: ...
|
||||
|
||||
else:
|
||||
def _format_callback_source(func: object, args: Iterable[Any]) -> str: ...
|
||||
def _format_args_and_kwargs(args: Iterable[Any], kwargs: dict[str, Any]) -> str: ...
|
||||
def _format_callback(func: object, args: Iterable[Any], kwargs: dict[str, Any], suffix: str = "") -> str: ...
|
||||
|
||||
def extract_stack(f: FrameType | None = None, limit: int | None = None) -> traceback.StackSummary: ...
|
||||
|
|
|
@ -10,13 +10,20 @@ if sys.version_info >= (3, 10):
|
|||
else:
|
||||
_LoopBoundMixin = object
|
||||
|
||||
__all__ = ("Queue", "PriorityQueue", "LifoQueue", "QueueFull", "QueueEmpty")
|
||||
|
||||
class QueueEmpty(Exception): ...
|
||||
class QueueFull(Exception): ...
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
__all__ = ("Queue", "PriorityQueue", "LifoQueue", "QueueFull", "QueueEmpty", "QueueShutDown")
|
||||
|
||||
else:
|
||||
__all__ = ("Queue", "PriorityQueue", "LifoQueue", "QueueFull", "QueueEmpty")
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
class QueueShutDown(Exception): ...
|
||||
|
||||
# If Generic[_T] is last and _LoopBoundMixin is object, pyright is unhappy.
|
||||
# We can remove the noqa pragma when dropping 3.9 support.
|
||||
class Queue(Generic[_T], _LoopBoundMixin): # noqa: Y059
|
||||
|
@ -42,6 +49,8 @@ class Queue(Generic[_T], _LoopBoundMixin): # noqa: Y059
|
|||
def task_done(self) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, type: Any, /) -> GenericAlias: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def shutdown(self, immediate: bool = False) -> None: ...
|
||||
|
||||
class PriorityQueue(Queue[_T]): ...
|
||||
class LifoQueue(Queue[_T]): ...
|
||||
|
|
|
@ -2,6 +2,7 @@ import ssl
|
|||
import sys
|
||||
from _typeshed import ReadableBuffer, StrPath
|
||||
from collections.abc import AsyncIterator, Awaitable, Callable, Iterable, Sequence, Sized
|
||||
from types import ModuleType
|
||||
from typing import Any, Protocol, SupportsIndex
|
||||
from typing_extensions import Self, TypeAlias
|
||||
|
||||
|
@ -130,7 +131,10 @@ class StreamWriter:
|
|||
async def start_tls(
|
||||
self, sslcontext: ssl.SSLContext, *, server_hostname: str | None = None, ssl_handshake_timeout: float | None = None
|
||||
) -> None: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
def __del__(self, warnings: ModuleType = ...) -> None: ...
|
||||
elif sys.version_info >= (3, 11):
|
||||
def __del__(self) -> None: ...
|
||||
|
||||
class StreamReader(AsyncIterator[bytes]):
|
||||
|
|
|
@ -1,15 +1,55 @@
|
|||
import sys
|
||||
import types
|
||||
from _typeshed import StrPath
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from collections.abc import Callable
|
||||
from socket import socket
|
||||
from typing import Literal
|
||||
from typing_extensions import Self, TypeVarTuple, Unpack, deprecated
|
||||
|
||||
from .base_events import Server, _ProtocolFactory, _SSLContext
|
||||
from .events import AbstractEventLoop, BaseDefaultEventLoopPolicy
|
||||
from .selector_events import BaseSelectorEventLoop
|
||||
|
||||
_Ts = TypeVarTuple("_Ts")
|
||||
|
||||
if sys.platform != "win32":
|
||||
if sys.version_info >= (3, 14):
|
||||
__all__ = ("SelectorEventLoop", "DefaultEventLoopPolicy", "EventLoop")
|
||||
elif sys.version_info >= (3, 13):
|
||||
__all__ = (
|
||||
"SelectorEventLoop",
|
||||
"AbstractChildWatcher",
|
||||
"SafeChildWatcher",
|
||||
"FastChildWatcher",
|
||||
"PidfdChildWatcher",
|
||||
"MultiLoopChildWatcher",
|
||||
"ThreadedChildWatcher",
|
||||
"DefaultEventLoopPolicy",
|
||||
"EventLoop",
|
||||
)
|
||||
elif sys.version_info >= (3, 9):
|
||||
__all__ = (
|
||||
"SelectorEventLoop",
|
||||
"AbstractChildWatcher",
|
||||
"SafeChildWatcher",
|
||||
"FastChildWatcher",
|
||||
"PidfdChildWatcher",
|
||||
"MultiLoopChildWatcher",
|
||||
"ThreadedChildWatcher",
|
||||
"DefaultEventLoopPolicy",
|
||||
)
|
||||
else:
|
||||
__all__ = (
|
||||
"SelectorEventLoop",
|
||||
"AbstractChildWatcher",
|
||||
"SafeChildWatcher",
|
||||
"FastChildWatcher",
|
||||
"MultiLoopChildWatcher",
|
||||
"ThreadedChildWatcher",
|
||||
"DefaultEventLoopPolicy",
|
||||
)
|
||||
|
||||
# This is also technically not available on Win,
|
||||
# but other parts of typeshed need this definition.
|
||||
# So, it is special cased.
|
||||
|
@ -58,30 +98,6 @@ if sys.version_info < (3, 14):
|
|||
def is_active(self) -> bool: ...
|
||||
|
||||
if sys.platform != "win32":
|
||||
if sys.version_info >= (3, 14):
|
||||
__all__ = ("SelectorEventLoop", "DefaultEventLoopPolicy")
|
||||
elif sys.version_info >= (3, 9):
|
||||
__all__ = (
|
||||
"SelectorEventLoop",
|
||||
"AbstractChildWatcher",
|
||||
"SafeChildWatcher",
|
||||
"FastChildWatcher",
|
||||
"PidfdChildWatcher",
|
||||
"MultiLoopChildWatcher",
|
||||
"ThreadedChildWatcher",
|
||||
"DefaultEventLoopPolicy",
|
||||
)
|
||||
else:
|
||||
__all__ = (
|
||||
"SelectorEventLoop",
|
||||
"AbstractChildWatcher",
|
||||
"SafeChildWatcher",
|
||||
"FastChildWatcher",
|
||||
"MultiLoopChildWatcher",
|
||||
"ThreadedChildWatcher",
|
||||
"DefaultEventLoopPolicy",
|
||||
)
|
||||
|
||||
if sys.version_info < (3, 14):
|
||||
if sys.version_info >= (3, 12):
|
||||
# Doesn't actually have ABCMeta metaclass at runtime, but mypy complains if we don't have it in the stub.
|
||||
|
@ -141,7 +157,21 @@ if sys.platform != "win32":
|
|||
) -> None: ...
|
||||
def remove_child_handler(self, pid: int) -> bool: ...
|
||||
|
||||
class _UnixSelectorEventLoop(BaseSelectorEventLoop): ...
|
||||
class _UnixSelectorEventLoop(BaseSelectorEventLoop):
|
||||
if sys.version_info >= (3, 13):
|
||||
async def create_unix_server( # type: ignore[override]
|
||||
self,
|
||||
protocol_factory: _ProtocolFactory,
|
||||
path: StrPath | None = None,
|
||||
*,
|
||||
sock: socket | None = None,
|
||||
backlog: int = 100,
|
||||
ssl: _SSLContext = None,
|
||||
ssl_handshake_timeout: float | None = None,
|
||||
ssl_shutdown_timeout: float | None = None,
|
||||
start_serving: bool = True,
|
||||
cleanup_socket: bool = True,
|
||||
) -> Server: ...
|
||||
|
||||
class _UnixDefaultEventLoopPolicy(BaseDefaultEventLoopPolicy):
|
||||
if sys.version_info < (3, 14):
|
||||
|
@ -158,6 +188,9 @@ if sys.platform != "win32":
|
|||
|
||||
DefaultEventLoopPolicy = _UnixDefaultEventLoopPolicy
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
EventLoop = SelectorEventLoop
|
||||
|
||||
if sys.version_info < (3, 14):
|
||||
if sys.version_info >= (3, 12):
|
||||
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
||||
|
|
|
@ -7,14 +7,26 @@ from typing import IO, Any, ClassVar, Literal, NoReturn
|
|||
from . import events, futures, proactor_events, selector_events, streams, windows_utils
|
||||
|
||||
if sys.platform == "win32":
|
||||
__all__ = (
|
||||
"SelectorEventLoop",
|
||||
"ProactorEventLoop",
|
||||
"IocpProactor",
|
||||
"DefaultEventLoopPolicy",
|
||||
"WindowsSelectorEventLoopPolicy",
|
||||
"WindowsProactorEventLoopPolicy",
|
||||
)
|
||||
if sys.version_info >= (3, 13):
|
||||
# 3.13 added `EventLoop`.
|
||||
__all__ = (
|
||||
"SelectorEventLoop",
|
||||
"ProactorEventLoop",
|
||||
"IocpProactor",
|
||||
"DefaultEventLoopPolicy",
|
||||
"WindowsSelectorEventLoopPolicy",
|
||||
"WindowsProactorEventLoopPolicy",
|
||||
"EventLoop",
|
||||
)
|
||||
else:
|
||||
__all__ = (
|
||||
"SelectorEventLoop",
|
||||
"ProactorEventLoop",
|
||||
"IocpProactor",
|
||||
"DefaultEventLoopPolicy",
|
||||
"WindowsSelectorEventLoopPolicy",
|
||||
"WindowsProactorEventLoopPolicy",
|
||||
)
|
||||
|
||||
NULL: Literal[0]
|
||||
INFINITE: Literal[0xFFFFFFFF]
|
||||
|
@ -84,3 +96,5 @@ if sys.platform == "win32":
|
|||
def set_child_watcher(self, watcher: Any) -> NoReturn: ...
|
||||
|
||||
DefaultEventLoopPolicy = WindowsSelectorEventLoopPolicy
|
||||
if sys.version_info >= (3, 13):
|
||||
EventLoop = ProactorEventLoop
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import sys
|
||||
from _typeshed import ExcInfo, TraceFunction
|
||||
from _typeshed import ExcInfo, TraceFunction, Unused
|
||||
from collections.abc import Callable, Iterable, Mapping
|
||||
from types import CodeType, FrameType, TracebackType
|
||||
from typing import IO, Any, Literal, SupportsInt, TypeVar
|
||||
|
@ -32,6 +32,9 @@ class Bdb:
|
|||
def dispatch_call(self, frame: FrameType, arg: None) -> TraceFunction: ...
|
||||
def dispatch_return(self, frame: FrameType, arg: Any) -> TraceFunction: ...
|
||||
def dispatch_exception(self, frame: FrameType, arg: ExcInfo) -> TraceFunction: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def dispatch_opcode(self, frame: FrameType, arg: Unused) -> Callable[[FrameType, str, Any], TraceFunction]: ...
|
||||
|
||||
def is_skipped_module(self, module_name: str) -> bool: ...
|
||||
def stop_here(self, frame: FrameType) -> bool: ...
|
||||
def break_here(self, frame: FrameType) -> bool: ...
|
||||
|
@ -42,7 +45,13 @@ class Bdb:
|
|||
def user_return(self, frame: FrameType, return_value: Any) -> None: ...
|
||||
def user_exception(self, frame: FrameType, exc_info: ExcInfo) -> None: ...
|
||||
def set_until(self, frame: FrameType, lineno: int | None = None) -> None: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def user_opcode(self, frame: FrameType) -> None: ... # undocumented
|
||||
|
||||
def set_step(self) -> None: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def set_stepinstr(self) -> None: ... # undocumented
|
||||
|
||||
def set_next(self, frame: FrameType) -> None: ...
|
||||
def set_return(self, frame: FrameType) -> None: ...
|
||||
def set_trace(self, frame: FrameType | None = None) -> None: ...
|
||||
|
|
|
@ -75,6 +75,7 @@ if sys.version_info >= (3, 9):
|
|||
from types import GenericAlias
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_I = TypeVar("_I", default=int)
|
||||
_T_co = TypeVar("_T_co", covariant=True)
|
||||
_T_contra = TypeVar("_T_contra", contravariant=True)
|
||||
_R_co = TypeVar("_R_co", covariant=True)
|
||||
|
@ -823,8 +824,12 @@ class bytearray(MutableSequence[int]):
|
|||
def __buffer__(self, flags: int, /) -> memoryview: ...
|
||||
def __release_buffer__(self, buffer: memoryview, /) -> None: ...
|
||||
|
||||
_IntegerFormats: TypeAlias = Literal[
|
||||
"b", "B", "@b", "@B", "h", "H", "@h", "@H", "i", "I", "@i", "@I", "l", "L", "@l", "@L", "q", "Q", "@q", "@Q", "P", "@P"
|
||||
]
|
||||
|
||||
@final
|
||||
class memoryview(Sequence[int]):
|
||||
class memoryview(Sequence[_I]):
|
||||
@property
|
||||
def format(self) -> str: ...
|
||||
@property
|
||||
|
@ -854,13 +859,20 @@ class memoryview(Sequence[int]):
|
|||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None, /
|
||||
) -> None: ...
|
||||
def cast(self, format: str, shape: list[int] | tuple[int, ...] = ...) -> memoryview: ...
|
||||
@overload
|
||||
def __getitem__(self, key: SupportsIndex | tuple[SupportsIndex, ...], /) -> int: ...
|
||||
def cast(self, format: Literal["c", "@c"], shape: list[int] | tuple[int, ...] = ...) -> memoryview[bytes]: ...
|
||||
@overload
|
||||
def __getitem__(self, key: slice, /) -> memoryview: ...
|
||||
def cast(self, format: Literal["f", "@f", "d", "@d"], shape: list[int] | tuple[int, ...] = ...) -> memoryview[float]: ...
|
||||
@overload
|
||||
def cast(self, format: Literal["?"], shape: list[int] | tuple[int, ...] = ...) -> memoryview[bool]: ...
|
||||
@overload
|
||||
def cast(self, format: _IntegerFormats, shape: list[int] | tuple[int, ...] = ...) -> memoryview: ...
|
||||
@overload
|
||||
def __getitem__(self, key: SupportsIndex | tuple[SupportsIndex, ...], /) -> _I: ...
|
||||
@overload
|
||||
def __getitem__(self, key: slice, /) -> memoryview[_I]: ...
|
||||
def __contains__(self, x: object, /) -> bool: ...
|
||||
def __iter__(self) -> Iterator[int]: ...
|
||||
def __iter__(self) -> Iterator[_I]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __eq__(self, value: object, /) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
@ -2006,9 +2018,9 @@ if sys.version_info >= (3, 10):
|
|||
class EncodingWarning(Warning): ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
_BaseExceptionT_co = TypeVar("_BaseExceptionT_co", bound=BaseException, covariant=True)
|
||||
_BaseExceptionT_co = TypeVar("_BaseExceptionT_co", bound=BaseException, covariant=True, default=BaseException)
|
||||
_BaseExceptionT = TypeVar("_BaseExceptionT", bound=BaseException)
|
||||
_ExceptionT_co = TypeVar("_ExceptionT_co", bound=Exception, covariant=True)
|
||||
_ExceptionT_co = TypeVar("_ExceptionT_co", bound=Exception, covariant=True, default=Exception)
|
||||
_ExceptionT = TypeVar("_ExceptionT", bound=Exception)
|
||||
|
||||
# See `check_exception_group.py` for use-cases and comments.
|
||||
|
@ -2072,5 +2084,4 @@ if sys.version_info >= (3, 11):
|
|||
) -> tuple[ExceptionGroup[_ExceptionT_co] | None, ExceptionGroup[_ExceptionT_co] | None]: ...
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
class IncompleteInputError(SyntaxError): ...
|
||||
class PythonFinalizationError(RuntimeError): ...
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import sys
|
||||
|
||||
from ._base import (
|
||||
ALL_COMPLETED as ALL_COMPLETED,
|
||||
FIRST_COMPLETED as FIRST_COMPLETED,
|
||||
|
@ -14,19 +16,36 @@ from ._base import (
|
|||
from .process import ProcessPoolExecutor as ProcessPoolExecutor
|
||||
from .thread import ThreadPoolExecutor as ThreadPoolExecutor
|
||||
|
||||
__all__ = (
|
||||
"FIRST_COMPLETED",
|
||||
"FIRST_EXCEPTION",
|
||||
"ALL_COMPLETED",
|
||||
"CancelledError",
|
||||
"TimeoutError",
|
||||
"BrokenExecutor",
|
||||
"Future",
|
||||
"Executor",
|
||||
"wait",
|
||||
"as_completed",
|
||||
"ProcessPoolExecutor",
|
||||
"ThreadPoolExecutor",
|
||||
)
|
||||
if sys.version_info >= (3, 13):
|
||||
__all__ = (
|
||||
"FIRST_COMPLETED",
|
||||
"FIRST_EXCEPTION",
|
||||
"ALL_COMPLETED",
|
||||
"CancelledError",
|
||||
"TimeoutError",
|
||||
"InvalidStateError",
|
||||
"BrokenExecutor",
|
||||
"Future",
|
||||
"Executor",
|
||||
"wait",
|
||||
"as_completed",
|
||||
"ProcessPoolExecutor",
|
||||
"ThreadPoolExecutor",
|
||||
)
|
||||
else:
|
||||
__all__ = (
|
||||
"FIRST_COMPLETED",
|
||||
"FIRST_EXCEPTION",
|
||||
"ALL_COMPLETED",
|
||||
"CancelledError",
|
||||
"TimeoutError",
|
||||
"BrokenExecutor",
|
||||
"Future",
|
||||
"Executor",
|
||||
"wait",
|
||||
"as_completed",
|
||||
"ProcessPoolExecutor",
|
||||
"ThreadPoolExecutor",
|
||||
)
|
||||
|
||||
def __dir__() -> tuple[str, ...]: ...
|
||||
|
|
|
@ -19,6 +19,9 @@ if sys.platform != "win32":
|
|||
def reorganize(self) -> None: ...
|
||||
def sync(self) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def clear(self) -> None: ...
|
||||
|
||||
def __getitem__(self, item: _KeyType) -> bytes: ...
|
||||
def __setitem__(self, key: _KeyType, value: _ValueType) -> None: ...
|
||||
def __delitem__(self, key: _KeyType) -> None: ...
|
||||
|
|
|
@ -15,6 +15,9 @@ if sys.platform != "win32":
|
|||
# Actual typename dbm, not exposed by the implementation
|
||||
class _dbm:
|
||||
def close(self) -> None: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def clear(self) -> None: ...
|
||||
|
||||
def __getitem__(self, item: _KeyType) -> bytes: ...
|
||||
def __setitem__(self, key: _KeyType, value: _ValueType) -> None: ...
|
||||
def __delitem__(self, key: _KeyType) -> None: ...
|
||||
|
|
29
crates/red_knot_module_resolver/vendor/typeshed/stdlib/dbm/sqlite3.pyi
vendored
Normal file
29
crates/red_knot_module_resolver/vendor/typeshed/stdlib/dbm/sqlite3.pyi
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
from _typeshed import ReadableBuffer, StrOrBytesPath, Unused
|
||||
from collections.abc import Generator, MutableMapping
|
||||
from typing import Final, Literal
|
||||
from typing_extensions import LiteralString, Self, TypeAlias
|
||||
|
||||
BUILD_TABLE: Final[LiteralString]
|
||||
GET_SIZE: Final[LiteralString]
|
||||
LOOKUP_KEY: Final[LiteralString]
|
||||
STORE_KV: Final[LiteralString]
|
||||
DELETE_KEY: Final[LiteralString]
|
||||
ITER_KEYS: Final[LiteralString]
|
||||
|
||||
_SqliteData: TypeAlias = str | ReadableBuffer | int | float
|
||||
|
||||
class error(OSError): ...
|
||||
|
||||
class _Database(MutableMapping[bytes, bytes]):
|
||||
def __init__(self, path: StrOrBytesPath, /, *, flag: Literal["r", "w", "c", "n"], mode: int) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __getitem__(self, key: _SqliteData) -> bytes: ...
|
||||
def __setitem__(self, key: _SqliteData, value: _SqliteData) -> None: ...
|
||||
def __delitem__(self, key: _SqliteData) -> None: ...
|
||||
def __iter__(self) -> Generator[bytes]: ...
|
||||
def close(self) -> None: ...
|
||||
def keys(self) -> list[bytes]: ... # type: ignore[override]
|
||||
def __enter__(self) -> Self: ...
|
||||
def __exit__(self, *args: Unused) -> None: ...
|
||||
|
||||
def open(filename: StrOrBytesPath, /, flag: Literal["r", "w,", "c", "n"] = "r", mode: int = 0o666) -> _Database: ...
|
|
@ -31,6 +31,9 @@ __all__ = [
|
|||
"EXTENDED_ARG",
|
||||
"stack_effect",
|
||||
]
|
||||
if sys.version_info >= (3, 13):
|
||||
__all__ += ["hasjump"]
|
||||
|
||||
if sys.version_info >= (3, 12):
|
||||
__all__ += ["hasarg", "hasexc"]
|
||||
else:
|
||||
|
@ -86,12 +89,41 @@ else:
|
|||
is_jump_target: bool
|
||||
|
||||
class Instruction(_Instruction):
|
||||
def _disassemble(self, lineno_width: int = 3, mark_as_current: bool = False, offset_width: int = 4) -> str: ...
|
||||
if sys.version_info < (3, 13):
|
||||
def _disassemble(self, lineno_width: int = 3, mark_as_current: bool = False, offset_width: int = 4) -> str: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
@property
|
||||
def oparg(self) -> int: ...
|
||||
@property
|
||||
def baseopcode(self) -> int: ...
|
||||
@property
|
||||
def baseopname(self) -> str: ...
|
||||
@property
|
||||
def cache_offset(self) -> int: ...
|
||||
@property
|
||||
def end_offset(self) -> int: ...
|
||||
@property
|
||||
def jump_target(self) -> int: ...
|
||||
@property
|
||||
def is_jump_target(self) -> bool: ...
|
||||
|
||||
class Bytecode:
|
||||
codeobj: types.CodeType
|
||||
first_line: int
|
||||
if sys.version_info >= (3, 11):
|
||||
if sys.version_info >= (3, 13):
|
||||
show_offsets: bool
|
||||
# 3.13 added `show_offsets`
|
||||
def __init__(
|
||||
self,
|
||||
x: _HaveCodeType | str,
|
||||
*,
|
||||
first_line: int | None = None,
|
||||
current_offset: int | None = None,
|
||||
show_caches: bool = False,
|
||||
adaptive: bool = False,
|
||||
show_offsets: bool = False,
|
||||
) -> None: ...
|
||||
elif sys.version_info >= (3, 11):
|
||||
def __init__(
|
||||
self,
|
||||
x: _HaveCodeType | str,
|
||||
|
@ -101,12 +133,15 @@ class Bytecode:
|
|||
show_caches: bool = False,
|
||||
adaptive: bool = False,
|
||||
) -> None: ...
|
||||
@classmethod
|
||||
def from_traceback(cls, tb: types.TracebackType, *, show_caches: bool = False, adaptive: bool = False) -> Self: ...
|
||||
else:
|
||||
def __init__(
|
||||
self, x: _HaveCodeType | str, *, first_line: int | None = None, current_offset: int | None = None
|
||||
) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
@classmethod
|
||||
def from_traceback(cls, tb: types.TracebackType, *, show_caches: bool = False, adaptive: bool = False) -> Self: ...
|
||||
else:
|
||||
@classmethod
|
||||
def from_traceback(cls, tb: types.TracebackType) -> Self: ...
|
||||
|
||||
|
@ -121,7 +156,41 @@ def findlinestarts(code: _HaveCodeType) -> Iterator[tuple[int, int]]: ...
|
|||
def pretty_flags(flags: int) -> str: ...
|
||||
def code_info(x: _HaveCodeType | str) -> str: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
if sys.version_info >= (3, 13):
|
||||
# 3.13 added `show_offsets`
|
||||
def dis(
|
||||
x: _HaveCodeType | str | bytes | bytearray | None = None,
|
||||
*,
|
||||
file: IO[str] | None = None,
|
||||
depth: int | None = None,
|
||||
show_caches: bool = False,
|
||||
adaptive: bool = False,
|
||||
show_offsets: bool = False,
|
||||
) -> None: ...
|
||||
def disassemble(
|
||||
co: _HaveCodeType,
|
||||
lasti: int = -1,
|
||||
*,
|
||||
file: IO[str] | None = None,
|
||||
show_caches: bool = False,
|
||||
adaptive: bool = False,
|
||||
show_offsets: bool = False,
|
||||
) -> None: ...
|
||||
def distb(
|
||||
tb: types.TracebackType | None = None,
|
||||
*,
|
||||
file: IO[str] | None = None,
|
||||
show_caches: bool = False,
|
||||
adaptive: bool = False,
|
||||
show_offsets: bool = False,
|
||||
) -> None: ...
|
||||
# 3.13 made `show_cache` `None` by default
|
||||
def get_instructions(
|
||||
x: _HaveCodeType, *, first_line: int | None = None, show_caches: bool | None = None, adaptive: bool = False
|
||||
) -> Iterator[Instruction]: ...
|
||||
|
||||
elif sys.version_info >= (3, 11):
|
||||
# 3.11 added `show_caches` and `adaptive`
|
||||
def dis(
|
||||
x: _HaveCodeType | str | bytes | bytearray | None = None,
|
||||
*,
|
||||
|
@ -130,19 +199,9 @@ if sys.version_info >= (3, 11):
|
|||
show_caches: bool = False,
|
||||
adaptive: bool = False,
|
||||
) -> None: ...
|
||||
|
||||
else:
|
||||
def dis(
|
||||
x: _HaveCodeType | str | bytes | bytearray | None = None, *, file: IO[str] | None = None, depth: int | None = None
|
||||
) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
def disassemble(
|
||||
co: _HaveCodeType, lasti: int = -1, *, file: IO[str] | None = None, show_caches: bool = False, adaptive: bool = False
|
||||
) -> None: ...
|
||||
def disco(
|
||||
co: _HaveCodeType, lasti: int = -1, *, file: IO[str] | None = None, show_caches: bool = False, adaptive: bool = False
|
||||
) -> None: ...
|
||||
def distb(
|
||||
tb: types.TracebackType | None = None, *, file: IO[str] | None = None, show_caches: bool = False, adaptive: bool = False
|
||||
) -> None: ...
|
||||
|
@ -151,9 +210,13 @@ if sys.version_info >= (3, 11):
|
|||
) -> Iterator[Instruction]: ...
|
||||
|
||||
else:
|
||||
def dis(
|
||||
x: _HaveCodeType | str | bytes | bytearray | None = None, *, file: IO[str] | None = None, depth: int | None = None
|
||||
) -> None: ...
|
||||
def disassemble(co: _HaveCodeType, lasti: int = -1, *, file: IO[str] | None = None) -> None: ...
|
||||
def disco(co: _HaveCodeType, lasti: int = -1, *, file: IO[str] | None = None) -> None: ...
|
||||
def distb(tb: types.TracebackType | None = None, *, file: IO[str] | None = None) -> None: ...
|
||||
def get_instructions(x: _HaveCodeType, *, first_line: int | None = None) -> Iterator[Instruction]: ...
|
||||
|
||||
def show_code(co: _HaveCodeType, *, file: IO[str] | None = None) -> None: ...
|
||||
|
||||
disco = disassemble
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import datetime
|
||||
import sys
|
||||
from _typeshed import Unused
|
||||
from collections.abc import Iterable
|
||||
from email import _ParamType
|
||||
from email.charset import Charset
|
||||
from typing import overload
|
||||
|
@ -28,9 +29,21 @@ _PDTZ: TypeAlias = tuple[int, int, int, int, int, int, int, int, int, int | None
|
|||
|
||||
def quote(str: str) -> str: ...
|
||||
def unquote(str: str) -> str: ...
|
||||
def parseaddr(addr: str | None) -> tuple[str, str]: ...
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
def parseaddr(addr: str | list[str], *, strict: bool = True) -> tuple[str, str]: ...
|
||||
|
||||
else:
|
||||
def parseaddr(addr: str) -> tuple[str, str]: ...
|
||||
|
||||
def formataddr(pair: tuple[str | None, str], charset: str | Charset = "utf-8") -> str: ...
|
||||
def getaddresses(fieldvalues: list[str]) -> list[tuple[str, str]]: ...
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
def getaddresses(fieldvalues: Iterable[str], *, strict: bool = True) -> list[tuple[str, str]]: ...
|
||||
|
||||
else:
|
||||
def getaddresses(fieldvalues: Iterable[str]) -> list[tuple[str, str]]: ...
|
||||
|
||||
@overload
|
||||
def parsedate(data: None) -> None: ...
|
||||
@overload
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import abc
|
||||
import pathlib
|
||||
import sys
|
||||
import types
|
||||
from _collections_abc import dict_keys, dict_values
|
||||
from _typeshed import StrPath
|
||||
from collections.abc import Iterable, Iterator, Mapping
|
||||
|
@ -36,11 +37,8 @@ if sys.version_info >= (3, 10):
|
|||
from importlib.metadata._meta import PackageMetadata as PackageMetadata, SimplePath
|
||||
def packages_distributions() -> Mapping[str, list[str]]: ...
|
||||
|
||||
if sys.version_info >= (3, 12):
|
||||
# It's generic but shouldn't be
|
||||
_SimplePath: TypeAlias = SimplePath[Any]
|
||||
else:
|
||||
_SimplePath: TypeAlias = SimplePath
|
||||
_SimplePath: TypeAlias = SimplePath
|
||||
|
||||
else:
|
||||
_SimplePath: TypeAlias = Path
|
||||
|
||||
|
@ -48,7 +46,9 @@ class PackageNotFoundError(ModuleNotFoundError):
|
|||
@property
|
||||
def name(self) -> str: ... # type: ignore[override]
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
if sys.version_info >= (3, 13):
|
||||
_EntryPointBase = object
|
||||
elif sys.version_info >= (3, 11):
|
||||
class DeprecatedTuple:
|
||||
def __getitem__(self, item: int) -> str: ...
|
||||
|
||||
|
@ -226,6 +226,9 @@ class Distribution(_distribution_parent):
|
|||
if sys.version_info >= (3, 10):
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
@property
|
||||
def origin(self) -> types.SimpleNamespace: ...
|
||||
|
||||
class DistributionFinder(MetaPathFinder):
|
||||
class Context:
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
import sys
|
||||
from _typeshed import StrPath
|
||||
from collections.abc import Iterator
|
||||
from typing import Any, Protocol, TypeVar, overload
|
||||
from os import PathLike
|
||||
from typing import Any, Protocol, overload
|
||||
from typing_extensions import TypeVar
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_T_co = TypeVar("_T_co", covariant=True)
|
||||
_T_co = TypeVar("_T_co", covariant=True, default=Any)
|
||||
|
||||
class PackageMetadata(Protocol):
|
||||
def __len__(self) -> int: ...
|
||||
|
@ -22,7 +25,18 @@ class PackageMetadata(Protocol):
|
|||
@overload
|
||||
def get(self, name: str, failobj: _T) -> _T | str: ...
|
||||
|
||||
if sys.version_info >= (3, 12):
|
||||
if sys.version_info >= (3, 13):
|
||||
class SimplePath(Protocol):
|
||||
def joinpath(self, other: StrPath, /) -> SimplePath: ...
|
||||
def __truediv__(self, other: StrPath, /) -> SimplePath: ...
|
||||
# Incorrect at runtime
|
||||
@property
|
||||
def parent(self) -> PathLike[str]: ...
|
||||
def read_text(self, encoding: str | None = None) -> str: ...
|
||||
def read_bytes(self) -> bytes: ...
|
||||
def exists(self) -> bool: ...
|
||||
|
||||
elif sys.version_info >= (3, 12):
|
||||
class SimplePath(Protocol[_T_co]):
|
||||
# At runtime this is defined as taking `str | _T`, but that causes trouble.
|
||||
# See #11436.
|
||||
|
|
2
crates/red_knot_module_resolver/vendor/typeshed/stdlib/importlib/metadata/diagnose.pyi
vendored
Normal file
2
crates/red_knot_module_resolver/vendor/typeshed/stdlib/importlib/metadata/diagnose.pyi
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
def inspect(path: str) -> None: ...
|
||||
def run() -> None: ...
|
|
@ -176,20 +176,24 @@ TPFLAGS_IS_ABSTRACT: Literal[1048576]
|
|||
modulesbyfile: dict[str, Any]
|
||||
|
||||
_GetMembersPredicateTypeGuard: TypeAlias = Callable[[Any], TypeGuard[_T]]
|
||||
_GetMembersPredicateTypeIs: TypeAlias = Callable[[Any], TypeIs[_T]]
|
||||
_GetMembersPredicate: TypeAlias = Callable[[Any], bool]
|
||||
_GetMembersReturnTypeGuard: TypeAlias = list[tuple[str, _T]]
|
||||
_GetMembersReturn: TypeAlias = list[tuple[str, Any]]
|
||||
_GetMembersReturn: TypeAlias = list[tuple[str, _T]]
|
||||
|
||||
@overload
|
||||
def getmembers(object: object, predicate: _GetMembersPredicateTypeGuard[_T]) -> _GetMembersReturnTypeGuard[_T]: ...
|
||||
def getmembers(object: object, predicate: _GetMembersPredicateTypeGuard[_T]) -> _GetMembersReturn[_T]: ...
|
||||
@overload
|
||||
def getmembers(object: object, predicate: _GetMembersPredicate | None = None) -> _GetMembersReturn: ...
|
||||
def getmembers(object: object, predicate: _GetMembersPredicateTypeIs[_T]) -> _GetMembersReturn[_T]: ...
|
||||
@overload
|
||||
def getmembers(object: object, predicate: _GetMembersPredicate | None = None) -> _GetMembersReturn[Any]: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
@overload
|
||||
def getmembers_static(object: object, predicate: _GetMembersPredicateTypeGuard[_T]) -> _GetMembersReturnTypeGuard[_T]: ...
|
||||
def getmembers_static(object: object, predicate: _GetMembersPredicateTypeGuard[_T]) -> _GetMembersReturn[_T]: ...
|
||||
@overload
|
||||
def getmembers_static(object: object, predicate: _GetMembersPredicate | None = None) -> _GetMembersReturn: ...
|
||||
def getmembers_static(object: object, predicate: _GetMembersPredicateTypeIs[_T]) -> _GetMembersReturn[_T]: ...
|
||||
@overload
|
||||
def getmembers_static(object: object, predicate: _GetMembersPredicate | None = None) -> _GetMembersReturn[Any]: ...
|
||||
|
||||
def getmodulename(path: StrPath) -> str | None: ...
|
||||
def ismodule(object: object) -> TypeIs[ModuleType]: ...
|
||||
|
|
|
@ -6,7 +6,7 @@ from _typeshed import FileDescriptorOrPath, ReadableBuffer, WriteableBuffer
|
|||
from collections.abc import Callable, Iterable, Iterator
|
||||
from os import _Opener
|
||||
from types import TracebackType
|
||||
from typing import IO, Any, BinaryIO, Literal, Protocol, TextIO, TypeVar, overload, type_check_only
|
||||
from typing import IO, Any, BinaryIO, Generic, Literal, Protocol, TextIO, TypeVar, overload, type_check_only
|
||||
from typing_extensions import Self
|
||||
|
||||
__all__ = [
|
||||
|
@ -173,12 +173,12 @@ class _WrappedBuffer(Protocol):
|
|||
# def seek(self, offset: Literal[0], whence: Literal[2]) -> int: ...
|
||||
# def tell(self) -> int: ...
|
||||
|
||||
# TODO: Should be generic over the buffer type, but needs to wait for
|
||||
# TypeVar defaults.
|
||||
class TextIOWrapper(TextIOBase, TextIO): # type: ignore[misc] # incompatible definitions of write in the base classes
|
||||
_BufferT_co = TypeVar("_BufferT_co", bound=_WrappedBuffer, default=_WrappedBuffer, covariant=True)
|
||||
|
||||
class TextIOWrapper(TextIOBase, TextIO, Generic[_BufferT_co]): # type: ignore[misc] # incompatible definitions of write in the base classes
|
||||
def __init__(
|
||||
self,
|
||||
buffer: _WrappedBuffer,
|
||||
buffer: _BufferT_co,
|
||||
encoding: str | None = None,
|
||||
errors: str | None = None,
|
||||
newline: str | None = None,
|
||||
|
@ -187,7 +187,7 @@ class TextIOWrapper(TextIOBase, TextIO): # type: ignore[misc] # incompatible d
|
|||
) -> None: ...
|
||||
# Equals the "buffer" argument passed in to the constructor.
|
||||
@property
|
||||
def buffer(self) -> BinaryIO: ...
|
||||
def buffer(self) -> _BufferT_co: ... # type: ignore[override]
|
||||
@property
|
||||
def closed(self) -> bool: ...
|
||||
@property
|
||||
|
@ -211,7 +211,7 @@ class TextIOWrapper(TextIOBase, TextIO): # type: ignore[misc] # incompatible d
|
|||
def readline(self, size: int = -1, /) -> str: ... # type: ignore[override]
|
||||
def readlines(self, hint: int = -1, /) -> list[str]: ... # type: ignore[override]
|
||||
# Equals the "buffer" argument passed in to the constructor.
|
||||
def detach(self) -> BinaryIO: ...
|
||||
def detach(self) -> _BufferT_co: ... # type: ignore[override]
|
||||
# TextIOWrapper's version of seek only supports a limited subset of
|
||||
# operations.
|
||||
def seek(self, cookie: int, whence: int = 0, /) -> int: ...
|
||||
|
|
|
@ -326,6 +326,10 @@ if sys.version_info >= (3, 10):
|
|||
|
||||
if sys.version_info >= (3, 12):
|
||||
class batched(Iterator[tuple[_T_co, ...]], Generic[_T_co]):
|
||||
def __new__(cls, iterable: Iterable[_T_co], n: int) -> Self: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def __new__(cls, iterable: Iterable[_T_co], n: int, *, strict: bool = False) -> Self: ...
|
||||
else:
|
||||
def __new__(cls, iterable: Iterable[_T_co], n: int) -> Self: ...
|
||||
|
||||
def __iter__(self) -> Self: ...
|
||||
def __next__(self) -> tuple[_T_co, ...]: ...
|
||||
|
|
|
@ -115,6 +115,14 @@ class Maildir(Mailbox[MaildirMessage]):
|
|||
def get_message(self, key: str) -> MaildirMessage: ...
|
||||
def get_bytes(self, key: str) -> bytes: ...
|
||||
def get_file(self, key: str) -> _ProxyFile[bytes]: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def get_info(self, key: str) -> str: ...
|
||||
def set_info(self, key: str, info: str) -> None: ...
|
||||
def get_flags(self, key: str) -> str: ...
|
||||
def set_flags(self, key: str, flags: str) -> None: ...
|
||||
def add_flag(self, key: str, flag: str) -> None: ...
|
||||
def remove_flag(self, key: str, flag: str) -> None: ...
|
||||
|
||||
def iterkeys(self) -> Iterator[str]: ...
|
||||
def __contains__(self, key: str) -> bool: ...
|
||||
def __len__(self) -> int: ...
|
||||
|
|
|
@ -45,6 +45,7 @@ class MimeTypes:
|
|||
types_map: tuple[dict[str, str], dict[str, str]]
|
||||
types_map_inv: tuple[dict[str, str], dict[str, str]]
|
||||
def __init__(self, filenames: tuple[str, ...] = (), strict: bool = True) -> None: ...
|
||||
def add_type(self, type: str, ext: str, strict: bool = True) -> None: ...
|
||||
def guess_extension(self, type: str, strict: bool = True) -> str | None: ...
|
||||
def guess_type(self, url: StrPath, strict: bool = True) -> tuple[str | None, str | None]: ...
|
||||
def guess_all_extensions(self, type: str, strict: bool = True) -> list[str]: ...
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import sys
|
||||
from _typeshed import ReadableBuffer, Unused
|
||||
from collections.abc import Iterable, Iterator, Sized
|
||||
from typing import Final, NoReturn, overload
|
||||
from typing import Final, Literal, NoReturn, overload
|
||||
from typing_extensions import Self
|
||||
|
||||
ACCESS_DEFAULT: int
|
||||
|
@ -77,7 +77,7 @@ class mmap(Iterable[int], Sized):
|
|||
def __buffer__(self, flags: int, /) -> memoryview: ...
|
||||
def __release_buffer__(self, buffer: memoryview, /) -> None: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def seekable(self) -> bool: ...
|
||||
def seekable(self) -> Literal[True]: ...
|
||||
|
||||
if sys.platform != "win32":
|
||||
MADV_NORMAL: int
|
||||
|
|
|
@ -113,7 +113,7 @@ class Path(PurePath):
|
|||
|
||||
if sys.version_info >= (3, 13):
|
||||
@classmethod
|
||||
def from_uri(cls, uri: str) -> Path: ...
|
||||
def from_uri(cls, uri: str) -> Self: ...
|
||||
def is_dir(self, *, follow_symlinks: bool = True) -> bool: ...
|
||||
def is_file(self, *, follow_symlinks: bool = True) -> bool: ...
|
||||
def read_text(self, encoding: str | None = None, errors: str | None = None, newline: str | None = None) -> str: ...
|
||||
|
|
|
@ -5,7 +5,7 @@ from cmd import Cmd
|
|||
from collections.abc import Callable, Iterable, Mapping, Sequence
|
||||
from inspect import _SourceObjectType
|
||||
from types import CodeType, FrameType, TracebackType
|
||||
from typing import IO, Any, ClassVar, TypeVar
|
||||
from typing import IO, Any, ClassVar, Final, TypeVar
|
||||
from typing_extensions import ParamSpec, Self
|
||||
|
||||
__all__ = ["run", "pm", "Pdb", "runeval", "runctx", "runcall", "set_trace", "post_mortem", "help"]
|
||||
|
@ -30,6 +30,9 @@ class Pdb(Bdb, Cmd):
|
|||
|
||||
commands_resuming: ClassVar[list[str]]
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
MAX_CHAINED_EXCEPTION_DEPTH: Final = 999
|
||||
|
||||
aliases: dict[str, str]
|
||||
mainpyfile: str
|
||||
_wait_for_mainpyfile: bool
|
||||
|
@ -58,8 +61,16 @@ class Pdb(Bdb, Cmd):
|
|||
if sys.version_info < (3, 11):
|
||||
def execRcLines(self) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
user_opcode = Bdb.user_line
|
||||
|
||||
def bp_commands(self, frame: FrameType) -> bool: ...
|
||||
def interaction(self, frame: FrameType | None, traceback: TracebackType | None) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
def interaction(self, frame: FrameType | None, tb_or_exc: TracebackType | BaseException | None) -> None: ...
|
||||
else:
|
||||
def interaction(self, frame: FrameType | None, traceback: TracebackType | None) -> None: ...
|
||||
|
||||
def displayhook(self, obj: object) -> None: ...
|
||||
def handle_command_def(self, line: str) -> bool: ...
|
||||
def defaultFile(self) -> str: ...
|
||||
|
@ -72,6 +83,9 @@ class Pdb(Bdb, Cmd):
|
|||
if sys.version_info < (3, 11):
|
||||
def _runscript(self, filename: str) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
def completedefault(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... # type: ignore[override]
|
||||
|
||||
def do_commands(self, arg: str) -> bool | None: ...
|
||||
def do_break(self, arg: str, temporary: bool = ...) -> bool | None: ...
|
||||
def do_tbreak(self, arg: str) -> bool | None: ...
|
||||
|
@ -81,6 +95,9 @@ class Pdb(Bdb, Cmd):
|
|||
def do_ignore(self, arg: str) -> bool | None: ...
|
||||
def do_clear(self, arg: str) -> bool | None: ...
|
||||
def do_where(self, arg: str) -> bool | None: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def do_exceptions(self, arg: str) -> bool | None: ...
|
||||
|
||||
def do_up(self, arg: str) -> bool | None: ...
|
||||
def do_down(self, arg: str) -> bool | None: ...
|
||||
def do_until(self, arg: str) -> bool | None: ...
|
||||
|
@ -125,8 +142,14 @@ class Pdb(Bdb, Cmd):
|
|||
def help_exec(self) -> None: ...
|
||||
def help_pdb(self) -> None: ...
|
||||
def sigint_handler(self, signum: signal.Signals, frame: FrameType) -> None: ...
|
||||
def message(self, msg: str) -> None: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def message(self, msg: str, end: str = "\n") -> None: ...
|
||||
else:
|
||||
def message(self, msg: str) -> None: ...
|
||||
|
||||
def error(self, msg: str) -> None: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def completenames(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... # type: ignore[override]
|
||||
if sys.version_info >= (3, 12):
|
||||
def set_convenience_variable(self, frame: FrameType, name: str, value: Any) -> None: ...
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ from builtins import list as _list # "list" conflicts with method name
|
|||
from collections.abc import Callable, Container, Mapping, MutableMapping
|
||||
from reprlib import Repr
|
||||
from types import MethodType, ModuleType, TracebackType
|
||||
from typing import IO, Any, AnyStr, Final, NoReturn, TypeVar
|
||||
from typing import IO, Any, AnyStr, Final, NoReturn, Protocol, TypeVar
|
||||
from typing_extensions import TypeGuard
|
||||
|
||||
__all__ = ["help"]
|
||||
|
@ -17,6 +17,9 @@ __date__: Final[str]
|
|||
__version__: Final[str]
|
||||
__credits__: Final[str]
|
||||
|
||||
class _Pager(Protocol):
|
||||
def __call__(self, text: str, title: str = "") -> None: ...
|
||||
|
||||
def pathdirs() -> list[str]: ...
|
||||
def getdoc(object: object) -> str: ...
|
||||
def splitdoc(doc: AnyStr) -> tuple[AnyStr, AnyStr]: ...
|
||||
|
@ -229,16 +232,36 @@ class TextDoc(Doc):
|
|||
doc: Any | None = None,
|
||||
) -> str: ...
|
||||
|
||||
def pager(text: str) -> None: ...
|
||||
def getpager() -> Callable[[str], None]: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def pager(text: str, title: str = "") -> None: ...
|
||||
|
||||
else:
|
||||
def pager(text: str) -> None: ...
|
||||
|
||||
def plain(text: str) -> str: ...
|
||||
def pipepager(text: str, cmd: str) -> None: ...
|
||||
def tempfilepager(text: str, cmd: str) -> None: ...
|
||||
def ttypager(text: str) -> None: ...
|
||||
def plainpager(text: str) -> None: ...
|
||||
def describe(thing: Any) -> str: ...
|
||||
def locate(path: str, forceload: bool = ...) -> object: ...
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
def get_pager() -> _Pager: ...
|
||||
def pipe_pager(text: str, cmd: str, title: str = "") -> None: ...
|
||||
def tempfile_pager(text: str, cmd: str, title: str = "") -> None: ...
|
||||
def tty_pager(text: str, title: str = "") -> None: ...
|
||||
def plain_pager(text: str, title: str = "") -> None: ...
|
||||
|
||||
# For backwards compatibility.
|
||||
getpager = get_pager
|
||||
pipepager = pipe_pager
|
||||
tempfilepager = tempfile_pager
|
||||
ttypager = tty_pager
|
||||
plainpager = plain_pager
|
||||
else:
|
||||
def getpager() -> Callable[[str], None]: ...
|
||||
def pipepager(text: str, cmd: str) -> None: ...
|
||||
def tempfilepager(text: str, cmd: str) -> None: ...
|
||||
def ttypager(text: str) -> None: ...
|
||||
def plainpager(text: str) -> None: ...
|
||||
|
||||
text: TextDoc
|
||||
html: HTMLDoc
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import sys
|
||||
from _typeshed import StrPath
|
||||
from collections.abc import Iterable
|
||||
|
||||
|
@ -13,7 +14,15 @@ def addsitedir(sitedir: str, known_paths: set[str] | None = None) -> None: ...
|
|||
def addsitepackages(known_paths: set[str] | None, prefixes: Iterable[str] | None = None) -> set[str] | None: ... # undocumented
|
||||
def addusersitepackages(known_paths: set[str] | None) -> set[str] | None: ... # undocumented
|
||||
def check_enableusersite() -> bool | None: ... # undocumented
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
def gethistoryfile() -> str: ... # undocumented
|
||||
|
||||
def enablerlcompleter() -> None: ... # undocumented
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
def register_readline() -> None: ... # undocumented
|
||||
|
||||
def execsitecustomize() -> None: ... # undocumented
|
||||
def execusercustomize() -> None: ... # undocumented
|
||||
def getsitepackages(prefixes: Iterable[str] | None = None) -> list[str]: ...
|
||||
|
|
|
@ -30,7 +30,8 @@ AT_LOCALE: dict[_NamedIntConstant, _NamedIntConstant]
|
|||
AT_UNICODE: dict[_NamedIntConstant, _NamedIntConstant]
|
||||
CH_LOCALE: dict[_NamedIntConstant, _NamedIntConstant]
|
||||
CH_UNICODE: dict[_NamedIntConstant, _NamedIntConstant]
|
||||
SRE_FLAG_TEMPLATE: int
|
||||
if sys.version_info < (3, 13):
|
||||
SRE_FLAG_TEMPLATE: int
|
||||
SRE_FLAG_IGNORECASE: int
|
||||
SRE_FLAG_LOCALE: int
|
||||
SRE_FLAG_MULTILINE: int
|
||||
|
|
|
@ -5,11 +5,30 @@ from typing import Any
|
|||
|
||||
__all__ = ["symtable", "SymbolTable", "Class", "Function", "Symbol"]
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
__all__ += ["SymbolTableType"]
|
||||
|
||||
def symtable(code: str, filename: str, compile_type: str) -> SymbolTable: ...
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
from enum import StrEnum
|
||||
|
||||
class SymbolTableType(StrEnum):
|
||||
MODULE = "module"
|
||||
FUNCTION = "function"
|
||||
CLASS = "class"
|
||||
ANNOTATION = "annotation"
|
||||
TYPE_ALIAS = "type alias"
|
||||
TYPE_PARAMETERS = "type parameters"
|
||||
TYPE_VARIABLE = "type variable"
|
||||
|
||||
class SymbolTable:
|
||||
def __init__(self, raw_table: Any, filename: str) -> None: ...
|
||||
def get_type(self) -> str: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def get_type(self) -> SymbolTableType: ...
|
||||
else:
|
||||
def get_type(self) -> str: ...
|
||||
|
||||
def get_id(self) -> int: ...
|
||||
def get_name(self) -> str: ...
|
||||
def get_lineno(self) -> int: ...
|
||||
|
@ -42,13 +61,23 @@ class Symbol:
|
|||
def get_name(self) -> str: ...
|
||||
def is_referenced(self) -> bool: ...
|
||||
def is_parameter(self) -> bool: ...
|
||||
if sys.version_info >= (3, 14):
|
||||
def is_type_parameter(self) -> bool: ...
|
||||
|
||||
def is_global(self) -> bool: ...
|
||||
def is_declared_global(self) -> bool: ...
|
||||
def is_local(self) -> bool: ...
|
||||
def is_annotated(self) -> bool: ...
|
||||
def is_free(self) -> bool: ...
|
||||
if sys.version_info >= (3, 14):
|
||||
def is_free_class(self) -> bool: ...
|
||||
|
||||
def is_imported(self) -> bool: ...
|
||||
def is_assigned(self) -> bool: ...
|
||||
if sys.version_info >= (3, 14):
|
||||
def is_comp_iter(self) -> bool: ...
|
||||
def is_comp_cell(self) -> bool: ...
|
||||
|
||||
def is_namespace(self) -> bool: ...
|
||||
def get_namespaces(self) -> Sequence[SymbolTable]: ...
|
||||
def get_namespace(self) -> SymbolTable: ...
|
||||
|
|
|
@ -355,7 +355,11 @@ def set_int_max_str_digits(maxdigits: int) -> None: ...
|
|||
def get_int_max_str_digits() -> int: ...
|
||||
|
||||
if sys.version_info >= (3, 12):
|
||||
def getunicodeinternedsize() -> int: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def getunicodeinternedsize(*, _only_immortal: bool = False) -> int: ...
|
||||
else:
|
||||
def getunicodeinternedsize() -> int: ...
|
||||
|
||||
def deactivate_stack_trampoline() -> None: ...
|
||||
def is_stack_trampoline_active() -> bool: ...
|
||||
# It always exists, but raises on non-linux platforms:
|
||||
|
|
|
@ -61,7 +61,7 @@ if sys.version_info >= (3, 10):
|
|||
def gettrace() -> TraceFunction | None: ...
|
||||
def getprofile() -> ProfileFunction | None: ...
|
||||
|
||||
def stack_size(size: int = ...) -> int: ...
|
||||
def stack_size(size: int = 0, /) -> int: ...
|
||||
|
||||
TIMEOUT_MAX: float
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import _tkinter
|
||||
import sys
|
||||
from _typeshed import Incomplete, StrEnum, StrOrBytesPath
|
||||
from collections.abc import Callable, Mapping, Sequence
|
||||
from collections.abc import Callable, Iterable, Mapping, Sequence
|
||||
from tkinter.constants import *
|
||||
from tkinter.font import _FontDescription
|
||||
from types import TracebackType
|
||||
|
@ -3331,9 +3331,33 @@ class PhotoImage(Image, _PhotoImageLike):
|
|||
def blank(self) -> None: ...
|
||||
def cget(self, option: str) -> str: ...
|
||||
def __getitem__(self, key: str) -> str: ... # always string: image['height'] can be '0'
|
||||
def copy(self) -> PhotoImage: ...
|
||||
def zoom(self, x: int, y: int | Literal[""] = "") -> PhotoImage: ...
|
||||
def subsample(self, x: int, y: int | Literal[""] = "") -> PhotoImage: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def copy(
|
||||
self,
|
||||
*,
|
||||
from_coords: Iterable[int] | None = None,
|
||||
zoom: int | tuple[int, int] | list[int] | None = None,
|
||||
subsample: int | tuple[int, int] | list[int] | None = None,
|
||||
) -> PhotoImage: ...
|
||||
def subsample(self, x: int, y: Literal[""] = "", *, from_coords: Iterable[int] | None = None) -> PhotoImage: ...
|
||||
def zoom(self, x: int, y: Literal[""] = "", *, from_coords: Iterable[int] | None = None) -> PhotoImage: ...
|
||||
def copy_replace(
|
||||
self,
|
||||
sourceImage: PhotoImage | str,
|
||||
*,
|
||||
from_coords: Iterable[int] | None = None,
|
||||
to: Iterable[int] | None = None,
|
||||
shrink: bool = False,
|
||||
zoom: int | tuple[int, int] | list[int] | None = None,
|
||||
subsample: int | tuple[int, int] | list[int] | None = None,
|
||||
# `None` defaults to overlay.
|
||||
compositingrule: Literal["overlay", "set"] | None = None,
|
||||
) -> None: ...
|
||||
else:
|
||||
def copy(self) -> PhotoImage: ...
|
||||
def zoom(self, x: int, y: int | Literal[""] = "") -> PhotoImage: ...
|
||||
def subsample(self, x: int, y: int | Literal[""] = "") -> PhotoImage: ...
|
||||
|
||||
def get(self, x: int, y: int) -> tuple[int, int, int]: ...
|
||||
def put(
|
||||
self,
|
||||
|
@ -3348,7 +3372,44 @@ class PhotoImage(Image, _PhotoImageLike):
|
|||
),
|
||||
to: tuple[int, int] | None = None,
|
||||
) -> None: ...
|
||||
def write(self, filename: StrOrBytesPath, format: str | None = None, from_coords: tuple[int, int] | None = None) -> None: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def read(
|
||||
self,
|
||||
filename: StrOrBytesPath,
|
||||
format: str | None = None,
|
||||
*,
|
||||
from_coords: Iterable[int] | None = None,
|
||||
to: Iterable[int] | None = None,
|
||||
shrink: bool = False,
|
||||
) -> None: ...
|
||||
def write(
|
||||
self,
|
||||
filename: StrOrBytesPath,
|
||||
format: str | None = None,
|
||||
from_coords: Iterable[int] | None = None,
|
||||
*,
|
||||
background: str | None = None,
|
||||
grayscale: bool = False,
|
||||
) -> None: ...
|
||||
@overload
|
||||
def data(
|
||||
self, format: str, *, from_coords: Iterable[int] | None = None, background: str | None = None, grayscale: bool = False
|
||||
) -> bytes: ...
|
||||
@overload
|
||||
def data(
|
||||
self,
|
||||
format: None = None,
|
||||
*,
|
||||
from_coords: Iterable[int] | None = None,
|
||||
background: str | None = None,
|
||||
grayscale: bool = False,
|
||||
) -> tuple[str, ...]: ...
|
||||
|
||||
else:
|
||||
def write(
|
||||
self, filename: StrOrBytesPath, format: str | None = None, from_coords: tuple[int, int] | None = None
|
||||
) -> None: ...
|
||||
|
||||
def transparency_get(self, x: int, y: int) -> bool: ...
|
||||
def transparency_set(self, x: int, y: int, boolean: bool) -> None: ...
|
||||
|
||||
|
|
|
@ -27,7 +27,18 @@ class CoverageResults:
|
|||
outfile: StrPath | None = None,
|
||||
) -> None: ... # undocumented
|
||||
def update(self, other: CoverageResults) -> None: ...
|
||||
def write_results(self, show_missing: bool = True, summary: bool = False, coverdir: StrPath | None = None) -> None: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def write_results(
|
||||
self,
|
||||
show_missing: bool = True,
|
||||
summary: bool = False,
|
||||
coverdir: StrPath | None = None,
|
||||
*,
|
||||
ignore_missing_files: bool = False,
|
||||
) -> None: ...
|
||||
else:
|
||||
def write_results(self, show_missing: bool = True, summary: bool = False, coverdir: StrPath | None = None) -> None: ...
|
||||
|
||||
def write_results_file(
|
||||
self, path: StrPath, lines: Sequence[str], lnotab: Any, lines_hit: Mapping[int, int], encoding: str | None = None
|
||||
) -> tuple[int, int]: ...
|
||||
|
|
|
@ -101,7 +101,6 @@ __all__ = [
|
|||
"setheading",
|
||||
"setpos",
|
||||
"setposition",
|
||||
"settiltangle",
|
||||
"setundobuffer",
|
||||
"setx",
|
||||
"sety",
|
||||
|
@ -132,6 +131,9 @@ __all__ = [
|
|||
if sys.version_info >= (3, 12):
|
||||
__all__ += ["teleport"]
|
||||
|
||||
if sys.version_info < (3, 13):
|
||||
__all__ += ["settiltangle"]
|
||||
|
||||
# Note: '_Color' is the alias we use for arguments and _AnyColor is the
|
||||
# alias we use for return types. Really, these two aliases should be the
|
||||
# same, but as per the "no union returns" typeshed policy, we'll return
|
||||
|
@ -399,7 +401,10 @@ class RawTurtle(TPen, TNavigator):
|
|||
self, t11: float | None = None, t12: float | None = None, t21: float | None = None, t22: float | None = None
|
||||
) -> None: ...
|
||||
def get_shapepoly(self) -> _PolygonCoords | None: ...
|
||||
def settiltangle(self, angle: float) -> None: ...
|
||||
|
||||
if sys.version_info < (3, 13):
|
||||
def settiltangle(self, angle: float) -> None: ...
|
||||
|
||||
@overload
|
||||
def tiltangle(self, angle: None = None) -> float: ...
|
||||
@overload
|
||||
|
@ -672,7 +677,10 @@ def shapetransform(
|
|||
t11: float | None = None, t12: float | None = None, t21: float | None = None, t22: float | None = None
|
||||
) -> None: ...
|
||||
def get_shapepoly() -> _PolygonCoords | None: ...
|
||||
def settiltangle(angle: float) -> None: ...
|
||||
|
||||
if sys.version_info < (3, 13):
|
||||
def settiltangle(angle: float) -> None: ...
|
||||
|
||||
@overload
|
||||
def tiltangle(angle: None = None) -> float: ...
|
||||
@overload
|
||||
|
|
|
@ -245,7 +245,7 @@ class CodeType:
|
|||
co_qualname: str = ...,
|
||||
co_linetable: bytes = ...,
|
||||
co_exceptiontable: bytes = ...,
|
||||
) -> CodeType: ...
|
||||
) -> Self: ...
|
||||
elif sys.version_info >= (3, 10):
|
||||
def replace(
|
||||
self,
|
||||
|
@ -266,7 +266,7 @@ class CodeType:
|
|||
co_filename: str = ...,
|
||||
co_name: str = ...,
|
||||
co_linetable: bytes = ...,
|
||||
) -> CodeType: ...
|
||||
) -> Self: ...
|
||||
else:
|
||||
def replace(
|
||||
self,
|
||||
|
@ -287,7 +287,10 @@ class CodeType:
|
|||
co_filename: str = ...,
|
||||
co_name: str = ...,
|
||||
co_lnotab: bytes = ...,
|
||||
) -> CodeType: ...
|
||||
) -> Self: ...
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
__replace__ = replace
|
||||
|
||||
@final
|
||||
class MappingProxyType(Mapping[_KT, _VT_co]):
|
||||
|
@ -309,11 +312,17 @@ class MappingProxyType(Mapping[_KT, _VT_co]):
|
|||
|
||||
class SimpleNamespace:
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
def __init__(self, **kwargs: Any) -> None: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def __init__(self, mapping_or_iterable: Mapping[str, Any] | Iterable[tuple[str, Any]] = (), /, **kwargs: Any) -> None: ...
|
||||
else:
|
||||
def __init__(self, **kwargs: Any) -> None: ...
|
||||
|
||||
def __eq__(self, value: object, /) -> bool: ...
|
||||
def __getattribute__(self, name: str, /) -> Any: ...
|
||||
def __setattr__(self, name: str, value: Any, /) -> None: ...
|
||||
def __delattr__(self, name: str, /) -> None: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def __replace__(self, **kwargs: Any) -> Self: ...
|
||||
|
||||
class ModuleType:
|
||||
__name__: str
|
||||
|
|
|
@ -542,16 +542,18 @@ class AsyncIterator(AsyncIterable[_T_co], Protocol[_T_co]):
|
|||
class AsyncGenerator(AsyncIterator[_YieldT_co], Generic[_YieldT_co, _SendT_contra]):
|
||||
def __anext__(self) -> Awaitable[_YieldT_co]: ...
|
||||
@abstractmethod
|
||||
def asend(self, value: _SendT_contra, /) -> Awaitable[_YieldT_co]: ...
|
||||
def asend(self, value: _SendT_contra, /) -> Coroutine[Any, Any, _YieldT_co]: ...
|
||||
@overload
|
||||
@abstractmethod
|
||||
def athrow(
|
||||
self, typ: type[BaseException], val: BaseException | object = None, tb: TracebackType | None = None, /
|
||||
) -> Awaitable[_YieldT_co]: ...
|
||||
) -> Coroutine[Any, Any, _YieldT_co]: ...
|
||||
@overload
|
||||
@abstractmethod
|
||||
def athrow(self, typ: BaseException, val: None = None, tb: TracebackType | None = None, /) -> Awaitable[_YieldT_co]: ...
|
||||
def aclose(self) -> Awaitable[None]: ...
|
||||
def athrow(
|
||||
self, typ: BaseException, val: None = None, tb: TracebackType | None = None, /
|
||||
) -> Coroutine[Any, Any, _YieldT_co]: ...
|
||||
def aclose(self) -> Coroutine[Any, Any, None]: ...
|
||||
@property
|
||||
def ag_await(self) -> Any: ...
|
||||
@property
|
||||
|
|
|
@ -11,13 +11,7 @@ from .case import (
|
|||
skipIf as skipIf,
|
||||
skipUnless as skipUnless,
|
||||
)
|
||||
from .loader import (
|
||||
TestLoader as TestLoader,
|
||||
defaultTestLoader as defaultTestLoader,
|
||||
findTestCases as findTestCases,
|
||||
getTestCaseNames as getTestCaseNames,
|
||||
makeSuite as makeSuite,
|
||||
)
|
||||
from .loader import TestLoader as TestLoader, defaultTestLoader as defaultTestLoader
|
||||
from .main import TestProgram as TestProgram, main as main
|
||||
from .result import TestResult as TestResult
|
||||
from .runner import TextTestResult as TextTestResult, TextTestRunner as TextTestRunner
|
||||
|
@ -52,12 +46,14 @@ __all__ = [
|
|||
"registerResult",
|
||||
"removeResult",
|
||||
"removeHandler",
|
||||
"getTestCaseNames",
|
||||
"makeSuite",
|
||||
"findTestCases",
|
||||
"addModuleCleanup",
|
||||
]
|
||||
|
||||
if sys.version_info < (3, 13):
|
||||
from .loader import findTestCases as findTestCases, getTestCaseNames as getTestCaseNames, makeSuite as makeSuite
|
||||
|
||||
__all__ += ["getTestCaseNames", "makeSuite", "findTestCases"]
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
__all__ += ["enterModuleContext", "doModuleCleanups"]
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import sys
|
||||
from asyncio.events import AbstractEventLoop
|
||||
from collections.abc import Awaitable, Callable
|
||||
from typing import TypeVar
|
||||
from typing_extensions import ParamSpec
|
||||
|
@ -12,6 +13,9 @@ _T = TypeVar("_T")
|
|||
_P = ParamSpec("_P")
|
||||
|
||||
class IsolatedAsyncioTestCase(TestCase):
|
||||
if sys.version_info >= (3, 13):
|
||||
loop_factory: Callable[[], AbstractEventLoop] | None = None
|
||||
|
||||
async def asyncSetUp(self) -> None: ...
|
||||
async def asyncTearDown(self) -> None: ...
|
||||
def addAsyncCleanup(self, func: Callable[_P, Awaitable[object]], /, *args: _P.args, **kwargs: _P.kwargs) -> None: ...
|
||||
|
|
|
@ -5,7 +5,7 @@ from collections.abc import Callable, Sequence
|
|||
from re import Pattern
|
||||
from types import ModuleType
|
||||
from typing import Any
|
||||
from typing_extensions import TypeAlias
|
||||
from typing_extensions import TypeAlias, deprecated
|
||||
|
||||
_SortComparisonMethod: TypeAlias = Callable[[str, str], int]
|
||||
_SuiteClass: TypeAlias = Callable[[list[unittest.case.TestCase]], unittest.suite.TestSuite]
|
||||
|
@ -34,18 +34,22 @@ class TestLoader:
|
|||
|
||||
defaultTestLoader: TestLoader
|
||||
|
||||
def getTestCaseNames(
|
||||
testCaseClass: type[unittest.case.TestCase],
|
||||
prefix: str,
|
||||
sortUsing: _SortComparisonMethod = ...,
|
||||
testNamePatterns: list[str] | None = None,
|
||||
) -> Sequence[str]: ...
|
||||
def makeSuite(
|
||||
testCaseClass: type[unittest.case.TestCase],
|
||||
prefix: str = "test",
|
||||
sortUsing: _SortComparisonMethod = ...,
|
||||
suiteClass: _SuiteClass = ...,
|
||||
) -> unittest.suite.TestSuite: ...
|
||||
def findTestCases(
|
||||
module: ModuleType, prefix: str = "test", sortUsing: _SortComparisonMethod = ..., suiteClass: _SuiteClass = ...
|
||||
) -> unittest.suite.TestSuite: ...
|
||||
if sys.version_info < (3, 13):
|
||||
@deprecated("Deprecated in Python 3.11; removal scheduled for Python 3.13")
|
||||
def getTestCaseNames(
|
||||
testCaseClass: type[unittest.case.TestCase],
|
||||
prefix: str,
|
||||
sortUsing: _SortComparisonMethod = ...,
|
||||
testNamePatterns: list[str] | None = None,
|
||||
) -> Sequence[str]: ...
|
||||
@deprecated("Deprecated in Python 3.11; removal scheduled for Python 3.13")
|
||||
def makeSuite(
|
||||
testCaseClass: type[unittest.case.TestCase],
|
||||
prefix: str = "test",
|
||||
sortUsing: _SortComparisonMethod = ...,
|
||||
suiteClass: _SuiteClass = ...,
|
||||
) -> unittest.suite.TestSuite: ...
|
||||
@deprecated("Deprecated in Python 3.11; removal scheduled for Python 3.13")
|
||||
def findTestCases(
|
||||
module: ModuleType, prefix: str = "test", sortUsing: _SortComparisonMethod = ..., suiteClass: _SuiteClass = ...
|
||||
) -> unittest.suite.TestSuite: ...
|
||||
|
|
|
@ -6,6 +6,7 @@ import unittest.suite
|
|||
from collections.abc import Iterable
|
||||
from types import ModuleType
|
||||
from typing import Any, Protocol
|
||||
from typing_extensions import deprecated
|
||||
|
||||
MAIN_EXAMPLES: str
|
||||
MODULE_EXAMPLES: str
|
||||
|
@ -61,7 +62,10 @@ class TestProgram:
|
|||
tb_locals: bool = False,
|
||||
) -> None: ...
|
||||
|
||||
def usageExit(self, msg: Any = None) -> None: ...
|
||||
if sys.version_info < (3, 13):
|
||||
@deprecated("Deprecated in Python 3.11; removal scheduled for Python 3.13")
|
||||
def usageExit(self, msg: Any = None) -> None: ...
|
||||
|
||||
def parseArgs(self, argv: list[str]) -> None: ...
|
||||
def createTests(self, from_discovery: bool = False, Loader: unittest.loader.TestLoader | None = None) -> None: ...
|
||||
def runTests(self) -> None: ... # undocumented
|
||||
|
|
|
@ -12,23 +12,44 @@ _F = TypeVar("_F", bound=Callable[..., Any])
|
|||
_AF = TypeVar("_AF", bound=Callable[..., Coroutine[Any, Any, Any]])
|
||||
_P = ParamSpec("_P")
|
||||
|
||||
__all__ = (
|
||||
"Mock",
|
||||
"MagicMock",
|
||||
"patch",
|
||||
"sentinel",
|
||||
"DEFAULT",
|
||||
"ANY",
|
||||
"call",
|
||||
"create_autospec",
|
||||
"AsyncMock",
|
||||
"FILTER_DIR",
|
||||
"NonCallableMock",
|
||||
"NonCallableMagicMock",
|
||||
"mock_open",
|
||||
"PropertyMock",
|
||||
"seal",
|
||||
)
|
||||
if sys.version_info >= (3, 13):
|
||||
# ThreadingMock added in 3.13
|
||||
__all__ = (
|
||||
"Mock",
|
||||
"MagicMock",
|
||||
"patch",
|
||||
"sentinel",
|
||||
"DEFAULT",
|
||||
"ANY",
|
||||
"call",
|
||||
"create_autospec",
|
||||
"ThreadingMock",
|
||||
"AsyncMock",
|
||||
"FILTER_DIR",
|
||||
"NonCallableMock",
|
||||
"NonCallableMagicMock",
|
||||
"mock_open",
|
||||
"PropertyMock",
|
||||
"seal",
|
||||
)
|
||||
else:
|
||||
__all__ = (
|
||||
"Mock",
|
||||
"MagicMock",
|
||||
"patch",
|
||||
"sentinel",
|
||||
"DEFAULT",
|
||||
"ANY",
|
||||
"call",
|
||||
"create_autospec",
|
||||
"AsyncMock",
|
||||
"FILTER_DIR",
|
||||
"NonCallableMock",
|
||||
"NonCallableMagicMock",
|
||||
"mock_open",
|
||||
"PropertyMock",
|
||||
"seal",
|
||||
)
|
||||
|
||||
if sys.version_info < (3, 9):
|
||||
__version__: Final[str]
|
||||
|
@ -124,7 +145,6 @@ class NonCallableMock(Base, Any):
|
|||
def __delattr__(self, name: str) -> None: ...
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
def __dir__(self) -> list[str]: ...
|
||||
def _calls_repr(self, prefix: str = "Calls") -> str: ...
|
||||
def assert_called_with(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def assert_not_called(self) -> None: ...
|
||||
def assert_called_once_with(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
|
@ -150,6 +170,10 @@ class NonCallableMock(Base, Any):
|
|||
def _format_mock_call_signature(self, args: Any, kwargs: Any) -> str: ...
|
||||
def _call_matcher(self, _call: tuple[_Call, ...]) -> _Call: ...
|
||||
def _get_child_mock(self, **kw: Any) -> NonCallableMock: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def _calls_repr(self) -> str: ...
|
||||
else:
|
||||
def _calls_repr(self, prefix: str = "Calls") -> str: ...
|
||||
|
||||
class CallableMixin(Base):
|
||||
side_effect: Any
|
||||
|
@ -427,4 +451,16 @@ class PropertyMock(Mock):
|
|||
def __get__(self, obj: _T, obj_type: type[_T] | None = None) -> Self: ...
|
||||
def __set__(self, obj: Any, val: Any) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 13):
|
||||
class ThreadingMixin(Base):
|
||||
DEFAULT_TIMEOUT: Final[float | None] = None
|
||||
|
||||
def __init__(self, /, *args: Any, timeout: float | None | _SentinelObject = ..., **kwargs: Any) -> None: ...
|
||||
# Same as `NonCallableMock.reset_mock.`
|
||||
def reset_mock(self, visited: Any = None, *, return_value: bool = False, side_effect: bool = False) -> None: ...
|
||||
def wait_until_called(self, *, timeout: float | None | _SentinelObject = ...) -> None: ...
|
||||
def wait_until_any_call_with(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
|
||||
class ThreadingMock(ThreadingMixin, MagicMixin, Mock): ...
|
||||
|
||||
def seal(mock: Any) -> None: ...
|
||||
|
|
|
@ -21,8 +21,10 @@ if sys.version_info >= (3, 13):
|
|||
|
||||
_T = TypeVar("_T")
|
||||
_W = TypeVar("_W", bound=list[WarningMessage] | None)
|
||||
_ActionKind: TypeAlias = Literal["default", "error", "ignore", "always", "module", "once"]
|
||||
|
||||
if sys.version_info >= (3, 14):
|
||||
_ActionKind: TypeAlias = Literal["default", "error", "ignore", "always", "module", "once"]
|
||||
else:
|
||||
_ActionKind: TypeAlias = Literal["default", "error", "ignore", "always", "all", "module", "once"]
|
||||
filters: Sequence[tuple[str, str | None, type[Warning], str | None, int]] # undocumented, do not mutate
|
||||
|
||||
def showwarning(
|
||||
|
|
|
@ -239,9 +239,15 @@ if sys.version_info >= (3, 9):
|
|||
def indent(tree: Element | ElementTree, space: str = " ", level: int = 0) -> None: ...
|
||||
|
||||
def parse(source: _FileRead, parser: XMLParser | None = None) -> ElementTree: ...
|
||||
def iterparse(
|
||||
source: _FileRead, events: Sequence[str] | None = None, parser: XMLParser | None = None
|
||||
) -> Iterator[tuple[str, Any]]: ...
|
||||
|
||||
class _IterParseIterator(Iterator[tuple[str, Any]]):
|
||||
def __next__(self) -> tuple[str, Any]: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def close(self) -> None: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def __del__(self) -> None: ...
|
||||
|
||||
def iterparse(source: _FileRead, events: Sequence[str] | None = None, parser: XMLParser | None = None) -> _IterParseIterator: ...
|
||||
|
||||
class XMLPullParser:
|
||||
def __init__(self, events: Sequence[str] | None = None, *, _parser: XMLParser | None = None) -> None: ...
|
||||
|
|
|
@ -206,6 +206,9 @@ class ZipInfo:
|
|||
compress_size: int
|
||||
file_size: int
|
||||
orig_filename: str # undocumented
|
||||
if sys.version_info >= (3, 13):
|
||||
compress_level: int | None
|
||||
|
||||
def __init__(self, filename: str = "NoName", date_time: _DateTuple = (1980, 1, 1, 0, 0, 0)) -> None: ...
|
||||
@classmethod
|
||||
def from_file(cls, filename: StrPath, arcname: StrPath | None = None, *, strict_timestamps: bool = True) -> Self: ...
|
||||
|
|
|
@ -3,12 +3,14 @@ from _typeshed import StrPath
|
|||
from collections.abc import Iterator, Sequence
|
||||
from io import TextIOWrapper
|
||||
from os import PathLike
|
||||
from typing import IO, Literal, overload
|
||||
from typing import IO, Literal, TypeVar, overload
|
||||
from typing_extensions import Self, TypeAlias
|
||||
from zipfile import ZipFile
|
||||
|
||||
_ReadWriteBinaryMode: TypeAlias = Literal["r", "w", "rb", "wb"]
|
||||
|
||||
_ZF = TypeVar("_ZF", bound=ZipFile)
|
||||
|
||||
if sys.version_info >= (3, 12):
|
||||
class InitializedState:
|
||||
def __init__(self, *args: object, **kwargs: object) -> None: ...
|
||||
|
@ -23,6 +25,9 @@ if sys.version_info >= (3, 12):
|
|||
@overload
|
||||
@classmethod
|
||||
def make(cls, source: StrPath | IO[bytes]) -> Self: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
@classmethod
|
||||
def inject(cls, zf: _ZF) -> _ZF: ...
|
||||
|
||||
class Path:
|
||||
root: CompleteDirs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue