mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-26 20:10:09 +00:00
Sync vendored typeshed stubs (#12116)
This commit is contained in:
parent
d1aeadc009
commit
db6ee74cbe
22 changed files with 417 additions and 230 deletions
|
@ -1 +1 @@
|
||||||
114409d49b43ba62a179ebb856fa70a5161f751e
|
dcab6e88883c629ede9637fb011958f8b4918f52
|
||||||
|
|
|
@ -34,6 +34,7 @@ _dummy_thread: 3.0-3.8
|
||||||
_dummy_threading: 3.0-3.8
|
_dummy_threading: 3.0-3.8
|
||||||
_heapq: 3.0-
|
_heapq: 3.0-
|
||||||
_imp: 3.0-
|
_imp: 3.0-
|
||||||
|
_interpchannels: 3.13-
|
||||||
_json: 3.0-
|
_json: 3.0-
|
||||||
_locale: 3.0-
|
_locale: 3.0-
|
||||||
_lsprof: 3.0-
|
_lsprof: 3.0-
|
||||||
|
|
84
crates/red_knot_module_resolver/vendor/typeshed/stdlib/_interpchannels.pyi
vendored
Normal file
84
crates/red_knot_module_resolver/vendor/typeshed/stdlib/_interpchannels.pyi
vendored
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
from _typeshed import structseq
|
||||||
|
from typing import Final, Literal, SupportsIndex, final
|
||||||
|
from typing_extensions import Buffer, Self
|
||||||
|
|
||||||
|
class ChannelError(RuntimeError): ...
|
||||||
|
class ChannelClosedError(ChannelError): ...
|
||||||
|
class ChannelEmptyError(ChannelError): ...
|
||||||
|
class ChannelNotEmptyError(ChannelError): ...
|
||||||
|
class ChannelNotFoundError(ChannelError): ...
|
||||||
|
|
||||||
|
# Mark as final, since instantiating ChannelID is not supported.
|
||||||
|
@final
|
||||||
|
class ChannelID:
|
||||||
|
@property
|
||||||
|
def end(self) -> Literal["send", "recv", "both"]: ...
|
||||||
|
@property
|
||||||
|
def send(self) -> Self: ...
|
||||||
|
@property
|
||||||
|
def recv(self) -> Self: ...
|
||||||
|
def __eq__(self, other: object) -> bool: ...
|
||||||
|
def __ge__(self, other: ChannelID) -> bool: ...
|
||||||
|
def __gt__(self, other: ChannelID) -> bool: ...
|
||||||
|
def __hash__(self) -> int: ...
|
||||||
|
def __index__(self) -> int: ...
|
||||||
|
def __int__(self) -> int: ...
|
||||||
|
def __le__(self, other: ChannelID) -> bool: ...
|
||||||
|
def __lt__(self, other: ChannelID) -> bool: ...
|
||||||
|
def __ne__(self, other: object) -> bool: ...
|
||||||
|
|
||||||
|
@final
|
||||||
|
class ChannelInfo(structseq[int], tuple[bool, bool, bool, int, int, int, int, int]):
|
||||||
|
__match_args__: Final = (
|
||||||
|
"open",
|
||||||
|
"closing",
|
||||||
|
"closed",
|
||||||
|
"count",
|
||||||
|
"num_interp_send",
|
||||||
|
"num_interp_send_released",
|
||||||
|
"num_interp_recv",
|
||||||
|
"num_interp_recv_released",
|
||||||
|
)
|
||||||
|
@property
|
||||||
|
def open(self) -> bool: ...
|
||||||
|
@property
|
||||||
|
def closing(self) -> bool: ...
|
||||||
|
@property
|
||||||
|
def closed(self) -> bool: ...
|
||||||
|
@property
|
||||||
|
def count(self) -> int: ... # type: ignore[override]
|
||||||
|
@property
|
||||||
|
def num_interp_send(self) -> int: ...
|
||||||
|
@property
|
||||||
|
def num_interp_send_released(self) -> int: ...
|
||||||
|
@property
|
||||||
|
def num_interp_recv(self) -> int: ...
|
||||||
|
@property
|
||||||
|
def num_interp_recv_released(self) -> int: ...
|
||||||
|
@property
|
||||||
|
def num_interp_both(self) -> int: ...
|
||||||
|
@property
|
||||||
|
def num_interp_both_recv_released(self) -> int: ...
|
||||||
|
@property
|
||||||
|
def num_interp_both_send_released(self) -> int: ...
|
||||||
|
@property
|
||||||
|
def num_interp_both_released(self) -> int: ...
|
||||||
|
@property
|
||||||
|
def recv_associated(self) -> bool: ...
|
||||||
|
@property
|
||||||
|
def recv_released(self) -> bool: ...
|
||||||
|
@property
|
||||||
|
def send_associated(self) -> bool: ...
|
||||||
|
@property
|
||||||
|
def send_released(self) -> bool: ...
|
||||||
|
|
||||||
|
def create() -> ChannelID: ...
|
||||||
|
def destroy(cid: SupportsIndex) -> None: ...
|
||||||
|
def list_all() -> list[ChannelID]: ...
|
||||||
|
def list_interpreters(cid: SupportsIndex, *, send: bool) -> list[int]: ...
|
||||||
|
def send(cid: SupportsIndex, obj: object, *, blocking: bool = True, timeout: float | None = None) -> None: ...
|
||||||
|
def send_buffer(cid: SupportsIndex, obj: Buffer, *, blocking: bool = True, timeout: float | None = None) -> None: ...
|
||||||
|
def recv(cid: SupportsIndex, default: object = ...) -> object: ...
|
||||||
|
def close(cid: SupportsIndex, *, send: bool = False, recv: bool = False) -> None: ...
|
||||||
|
def get_info(cid: SupportsIndex) -> ChannelInfo: ...
|
||||||
|
def release(cid: SupportsIndex, *, send: bool = False, recv: bool = False, force: bool = False) -> None: ...
|
|
@ -21,8 +21,9 @@ class ProxyType(Generic[_T]): # "weakproxy"
|
||||||
def __getattr__(self, attr: str) -> Any: ...
|
def __getattr__(self, attr: str) -> Any: ...
|
||||||
|
|
||||||
class ReferenceType(Generic[_T]):
|
class ReferenceType(Generic[_T]):
|
||||||
__callback__: Callable[[ReferenceType[_T]], Any]
|
__callback__: Callable[[Self], Any]
|
||||||
def __new__(cls, o: _T, callback: Callable[[ReferenceType[_T]], Any] | None = ..., /) -> Self: ...
|
def __new__(cls, o: _T, callback: Callable[[Self], Any] | None = ..., /) -> Self: ...
|
||||||
|
def __init__(self, o: _T, callback: Callable[[Self], Any] | None = ..., /) -> None: ...
|
||||||
def __call__(self) -> _T | None: ...
|
def __call__(self) -> _T | None: ...
|
||||||
def __eq__(self, value: object, /) -> bool: ...
|
def __eq__(self, value: object, /) -> bool: ...
|
||||||
def __hash__(self) -> int: ...
|
def __hash__(self) -> int: ...
|
||||||
|
|
|
@ -32,6 +32,7 @@ _T = TypeVar("_T")
|
||||||
_ActionT = TypeVar("_ActionT", bound=Action)
|
_ActionT = TypeVar("_ActionT", bound=Action)
|
||||||
_ArgumentParserT = TypeVar("_ArgumentParserT", bound=ArgumentParser)
|
_ArgumentParserT = TypeVar("_ArgumentParserT", bound=ArgumentParser)
|
||||||
_N = TypeVar("_N")
|
_N = TypeVar("_N")
|
||||||
|
_ActionType: TypeAlias = Callable[[str], Any] | FileType | str
|
||||||
# more precisely, Literal["store", "store_const", "store_true",
|
# more precisely, Literal["store", "store_const", "store_true",
|
||||||
# "store_false", "append", "append_const", "count", "help", "version",
|
# "store_false", "append", "append_const", "count", "help", "version",
|
||||||
# "extend"], but using this would make it hard to annotate callers
|
# "extend"], but using this would make it hard to annotate callers
|
||||||
|
@ -89,7 +90,7 @@ class _ActionsContainer:
|
||||||
nargs: int | _NArgsStr | _SUPPRESS_T | None = None,
|
nargs: int | _NArgsStr | _SUPPRESS_T | None = None,
|
||||||
const: Any = ...,
|
const: Any = ...,
|
||||||
default: Any = ...,
|
default: Any = ...,
|
||||||
type: Callable[[str], _T] | FileType = ...,
|
type: _ActionType = ...,
|
||||||
choices: Iterable[_T] | None = ...,
|
choices: Iterable[_T] | None = ...,
|
||||||
required: bool = ...,
|
required: bool = ...,
|
||||||
help: str | None = ...,
|
help: str | None = ...,
|
||||||
|
@ -313,7 +314,7 @@ class Action(_AttributeHolder):
|
||||||
nargs: int | str | None
|
nargs: int | str | None
|
||||||
const: Any
|
const: Any
|
||||||
default: Any
|
default: Any
|
||||||
type: Callable[[str], Any] | FileType | None
|
type: _ActionType | None
|
||||||
choices: Iterable[Any] | None
|
choices: Iterable[Any] | None
|
||||||
required: bool
|
required: bool
|
||||||
help: str | None
|
help: str | None
|
||||||
|
@ -699,6 +700,7 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]):
|
||||||
add_help: bool = ...,
|
add_help: bool = ...,
|
||||||
allow_abbrev: bool = ...,
|
allow_abbrev: bool = ...,
|
||||||
exit_on_error: bool = ...,
|
exit_on_error: bool = ...,
|
||||||
|
**kwargs: Any, # Accepting any additional kwargs for custom parser classes
|
||||||
) -> _ArgumentParserT: ...
|
) -> _ArgumentParserT: ...
|
||||||
elif sys.version_info >= (3, 9):
|
elif sys.version_info >= (3, 9):
|
||||||
def add_parser(
|
def add_parser(
|
||||||
|
@ -721,6 +723,7 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]):
|
||||||
add_help: bool = ...,
|
add_help: bool = ...,
|
||||||
allow_abbrev: bool = ...,
|
allow_abbrev: bool = ...,
|
||||||
exit_on_error: bool = ...,
|
exit_on_error: bool = ...,
|
||||||
|
**kwargs: Any, # Accepting any additional kwargs for custom parser classes
|
||||||
) -> _ArgumentParserT: ...
|
) -> _ArgumentParserT: ...
|
||||||
else:
|
else:
|
||||||
def add_parser(
|
def add_parser(
|
||||||
|
@ -742,6 +745,7 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]):
|
||||||
conflict_handler: str = ...,
|
conflict_handler: str = ...,
|
||||||
add_help: bool = ...,
|
add_help: bool = ...,
|
||||||
allow_abbrev: bool = ...,
|
allow_abbrev: bool = ...,
|
||||||
|
**kwargs: Any, # Accepting any additional kwargs for custom parser classes
|
||||||
) -> _ArgumentParserT: ...
|
) -> _ArgumentParserT: ...
|
||||||
|
|
||||||
def _get_subactions(self) -> list[Action]: ...
|
def _get_subactions(self) -> list[Action]: ...
|
||||||
|
|
|
@ -16,23 +16,40 @@ from .tasks import Task
|
||||||
from .transports import BaseTransport, DatagramTransport, ReadTransport, SubprocessTransport, Transport, WriteTransport
|
from .transports import BaseTransport, DatagramTransport, ReadTransport, SubprocessTransport, Transport, WriteTransport
|
||||||
from .unix_events import AbstractChildWatcher
|
from .unix_events import AbstractChildWatcher
|
||||||
|
|
||||||
__all__ = (
|
if sys.version_info >= (3, 14):
|
||||||
"AbstractEventLoopPolicy",
|
__all__ = (
|
||||||
"AbstractEventLoop",
|
"AbstractEventLoopPolicy",
|
||||||
"AbstractServer",
|
"AbstractEventLoop",
|
||||||
"Handle",
|
"AbstractServer",
|
||||||
"TimerHandle",
|
"Handle",
|
||||||
"get_event_loop_policy",
|
"TimerHandle",
|
||||||
"set_event_loop_policy",
|
"get_event_loop_policy",
|
||||||
"get_event_loop",
|
"set_event_loop_policy",
|
||||||
"set_event_loop",
|
"get_event_loop",
|
||||||
"new_event_loop",
|
"set_event_loop",
|
||||||
"get_child_watcher",
|
"new_event_loop",
|
||||||
"set_child_watcher",
|
"_set_running_loop",
|
||||||
"_set_running_loop",
|
"get_running_loop",
|
||||||
"get_running_loop",
|
"_get_running_loop",
|
||||||
"_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",
|
||||||
|
"_get_running_loop",
|
||||||
|
)
|
||||||
|
|
||||||
_T = TypeVar("_T")
|
_T = TypeVar("_T")
|
||||||
_Ts = TypeVarTuple("_Ts")
|
_Ts = TypeVarTuple("_Ts")
|
||||||
|
@ -541,18 +558,19 @@ class AbstractEventLoopPolicy:
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def new_event_loop(self) -> AbstractEventLoop: ...
|
def new_event_loop(self) -> AbstractEventLoop: ...
|
||||||
# Child processes handling (Unix only).
|
# Child processes handling (Unix only).
|
||||||
if sys.version_info >= (3, 12):
|
if sys.version_info < (3, 14):
|
||||||
@abstractmethod
|
if sys.version_info >= (3, 12):
|
||||||
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
@abstractmethod
|
||||||
def get_child_watcher(self) -> AbstractChildWatcher: ...
|
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
||||||
@abstractmethod
|
def get_child_watcher(self) -> AbstractChildWatcher: ...
|
||||||
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
@abstractmethod
|
||||||
def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ...
|
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
||||||
else:
|
def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ...
|
||||||
@abstractmethod
|
else:
|
||||||
def get_child_watcher(self) -> AbstractChildWatcher: ...
|
@abstractmethod
|
||||||
@abstractmethod
|
def get_child_watcher(self) -> AbstractChildWatcher: ...
|
||||||
def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ...
|
@abstractmethod
|
||||||
|
def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ...
|
||||||
|
|
||||||
class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy, metaclass=ABCMeta):
|
class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy, metaclass=ABCMeta):
|
||||||
def get_event_loop(self) -> AbstractEventLoop: ...
|
def get_event_loop(self) -> AbstractEventLoop: ...
|
||||||
|
@ -565,15 +583,16 @@ def get_event_loop() -> AbstractEventLoop: ...
|
||||||
def set_event_loop(loop: AbstractEventLoop | None) -> None: ...
|
def set_event_loop(loop: AbstractEventLoop | None) -> None: ...
|
||||||
def new_event_loop() -> AbstractEventLoop: ...
|
def new_event_loop() -> AbstractEventLoop: ...
|
||||||
|
|
||||||
if sys.version_info >= (3, 12):
|
if sys.version_info < (3, 14):
|
||||||
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
if sys.version_info >= (3, 12):
|
||||||
def get_child_watcher() -> AbstractChildWatcher: ...
|
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
||||||
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
def get_child_watcher() -> AbstractChildWatcher: ...
|
||||||
def set_child_watcher(watcher: AbstractChildWatcher) -> None: ...
|
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
||||||
|
def set_child_watcher(watcher: AbstractChildWatcher) -> None: ...
|
||||||
|
|
||||||
else:
|
else:
|
||||||
def get_child_watcher() -> AbstractChildWatcher: ...
|
def get_child_watcher() -> AbstractChildWatcher: ...
|
||||||
def set_child_watcher(watcher: AbstractChildWatcher) -> None: ...
|
def set_child_watcher(watcher: AbstractChildWatcher) -> None: ...
|
||||||
|
|
||||||
def _set_running_loop(loop: AbstractEventLoop | None, /) -> None: ...
|
def _set_running_loop(loop: AbstractEventLoop | None, /) -> None: ...
|
||||||
def _get_running_loop() -> AbstractEventLoop: ...
|
def _get_running_loop() -> AbstractEventLoop: ...
|
||||||
|
|
|
@ -70,7 +70,10 @@ _T4 = TypeVar("_T4")
|
||||||
_T5 = TypeVar("_T5")
|
_T5 = TypeVar("_T5")
|
||||||
_T6 = TypeVar("_T6")
|
_T6 = TypeVar("_T6")
|
||||||
_FT = TypeVar("_FT", bound=Future[Any])
|
_FT = TypeVar("_FT", bound=Future[Any])
|
||||||
_FutureLike: TypeAlias = Future[_T] | Generator[Any, None, _T] | Awaitable[_T]
|
if sys.version_info >= (3, 12):
|
||||||
|
_FutureLike: TypeAlias = Future[_T] | Awaitable[_T]
|
||||||
|
else:
|
||||||
|
_FutureLike: TypeAlias = Future[_T] | Generator[Any, None, _T] | Awaitable[_T]
|
||||||
_TaskYieldType: TypeAlias = Future[object] | None
|
_TaskYieldType: TypeAlias = Future[object] | None
|
||||||
|
|
||||||
FIRST_COMPLETED = concurrent.futures.FIRST_COMPLETED
|
FIRST_COMPLETED = concurrent.futures.FIRST_COMPLETED
|
||||||
|
|
|
@ -13,51 +13,54 @@ _Ts = TypeVarTuple("_Ts")
|
||||||
# This is also technically not available on Win,
|
# This is also technically not available on Win,
|
||||||
# but other parts of typeshed need this definition.
|
# but other parts of typeshed need this definition.
|
||||||
# So, it is special cased.
|
# So, it is special cased.
|
||||||
if sys.version_info >= (3, 12):
|
if sys.version_info < (3, 14):
|
||||||
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
if sys.version_info >= (3, 12):
|
||||||
class AbstractChildWatcher:
|
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
||||||
@abstractmethod
|
class AbstractChildWatcher:
|
||||||
def add_child_handler(
|
@abstractmethod
|
||||||
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
def add_child_handler(
|
||||||
) -> None: ...
|
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
||||||
@abstractmethod
|
) -> None: ...
|
||||||
def remove_child_handler(self, pid: int) -> bool: ...
|
@abstractmethod
|
||||||
@abstractmethod
|
def remove_child_handler(self, pid: int) -> bool: ...
|
||||||
def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
|
@abstractmethod
|
||||||
@abstractmethod
|
def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
|
||||||
def close(self) -> None: ...
|
@abstractmethod
|
||||||
@abstractmethod
|
def close(self) -> None: ...
|
||||||
def __enter__(self) -> Self: ...
|
@abstractmethod
|
||||||
@abstractmethod
|
def __enter__(self) -> Self: ...
|
||||||
def __exit__(
|
@abstractmethod
|
||||||
self, typ: type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None
|
def __exit__(
|
||||||
) -> None: ...
|
self, typ: type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None
|
||||||
@abstractmethod
|
) -> None: ...
|
||||||
def is_active(self) -> bool: ...
|
@abstractmethod
|
||||||
|
def is_active(self) -> bool: ...
|
||||||
|
|
||||||
else:
|
else:
|
||||||
class AbstractChildWatcher:
|
class AbstractChildWatcher:
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def add_child_handler(
|
def add_child_handler(
|
||||||
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def remove_child_handler(self, pid: int) -> bool: ...
|
def remove_child_handler(self, pid: int) -> bool: ...
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
|
def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def close(self) -> None: ...
|
def close(self) -> None: ...
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def __enter__(self) -> Self: ...
|
def __enter__(self) -> Self: ...
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def __exit__(
|
def __exit__(
|
||||||
self, typ: type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None
|
self, typ: type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def is_active(self) -> bool: ...
|
def is_active(self) -> bool: ...
|
||||||
|
|
||||||
if sys.platform != "win32":
|
if sys.platform != "win32":
|
||||||
if sys.version_info >= (3, 9):
|
if sys.version_info >= (3, 14):
|
||||||
|
__all__ = ("SelectorEventLoop", "DefaultEventLoopPolicy")
|
||||||
|
elif sys.version_info >= (3, 9):
|
||||||
__all__ = (
|
__all__ = (
|
||||||
"SelectorEventLoop",
|
"SelectorEventLoop",
|
||||||
"AbstractChildWatcher",
|
"AbstractChildWatcher",
|
||||||
|
@ -79,118 +82,137 @@ if sys.platform != "win32":
|
||||||
"DefaultEventLoopPolicy",
|
"DefaultEventLoopPolicy",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Doesn't actually have ABCMeta metaclass at runtime, but mypy complains if we don't have it in the stub.
|
if sys.version_info < (3, 14):
|
||||||
# See discussion in #7412
|
if sys.version_info >= (3, 12):
|
||||||
class BaseChildWatcher(AbstractChildWatcher, metaclass=ABCMeta):
|
# Doesn't actually have ABCMeta metaclass at runtime, but mypy complains if we don't have it in the stub.
|
||||||
def close(self) -> None: ...
|
# See discussion in #7412
|
||||||
def is_active(self) -> bool: ...
|
class BaseChildWatcher(AbstractChildWatcher, metaclass=ABCMeta):
|
||||||
def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
|
def close(self) -> None: ...
|
||||||
|
def is_active(self) -> bool: ...
|
||||||
|
def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
|
||||||
|
|
||||||
if sys.version_info >= (3, 12):
|
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
||||||
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
class SafeChildWatcher(BaseChildWatcher):
|
||||||
class SafeChildWatcher(BaseChildWatcher):
|
def __enter__(self) -> Self: ...
|
||||||
def __enter__(self) -> Self: ...
|
def __exit__(
|
||||||
def __exit__(self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None) -> None: ...
|
self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None
|
||||||
def add_child_handler(
|
) -> None: ...
|
||||||
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
def add_child_handler(
|
||||||
) -> None: ...
|
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
||||||
def remove_child_handler(self, pid: int) -> bool: ...
|
) -> None: ...
|
||||||
|
def remove_child_handler(self, pid: int) -> bool: ...
|
||||||
|
|
||||||
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
||||||
class FastChildWatcher(BaseChildWatcher):
|
class FastChildWatcher(BaseChildWatcher):
|
||||||
def __enter__(self) -> Self: ...
|
def __enter__(self) -> Self: ...
|
||||||
def __exit__(self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None) -> None: ...
|
def __exit__(
|
||||||
def add_child_handler(
|
self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None
|
||||||
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
) -> None: ...
|
||||||
) -> None: ...
|
def add_child_handler(
|
||||||
def remove_child_handler(self, pid: int) -> bool: ...
|
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
||||||
|
) -> None: ...
|
||||||
|
def remove_child_handler(self, pid: int) -> bool: ...
|
||||||
|
|
||||||
else:
|
else:
|
||||||
class SafeChildWatcher(BaseChildWatcher):
|
# Doesn't actually have ABCMeta metaclass at runtime, but mypy complains if we don't have it in the stub.
|
||||||
def __enter__(self) -> Self: ...
|
# See discussion in #7412
|
||||||
def __exit__(self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None) -> None: ...
|
class BaseChildWatcher(AbstractChildWatcher, metaclass=ABCMeta):
|
||||||
def add_child_handler(
|
def close(self) -> None: ...
|
||||||
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
def is_active(self) -> bool: ...
|
||||||
) -> None: ...
|
def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
|
||||||
def remove_child_handler(self, pid: int) -> bool: ...
|
|
||||||
|
|
||||||
class FastChildWatcher(BaseChildWatcher):
|
class SafeChildWatcher(BaseChildWatcher):
|
||||||
def __enter__(self) -> Self: ...
|
def __enter__(self) -> Self: ...
|
||||||
def __exit__(self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None) -> None: ...
|
def __exit__(
|
||||||
def add_child_handler(
|
self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None
|
||||||
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
) -> None: ...
|
||||||
) -> None: ...
|
def add_child_handler(
|
||||||
def remove_child_handler(self, pid: int) -> bool: ...
|
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
||||||
|
) -> None: ...
|
||||||
|
def remove_child_handler(self, pid: int) -> bool: ...
|
||||||
|
|
||||||
|
class FastChildWatcher(BaseChildWatcher):
|
||||||
|
def __enter__(self) -> Self: ...
|
||||||
|
def __exit__(
|
||||||
|
self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None
|
||||||
|
) -> None: ...
|
||||||
|
def add_child_handler(
|
||||||
|
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
||||||
|
) -> None: ...
|
||||||
|
def remove_child_handler(self, pid: int) -> bool: ...
|
||||||
|
|
||||||
class _UnixSelectorEventLoop(BaseSelectorEventLoop): ...
|
class _UnixSelectorEventLoop(BaseSelectorEventLoop): ...
|
||||||
|
|
||||||
class _UnixDefaultEventLoopPolicy(BaseDefaultEventLoopPolicy):
|
class _UnixDefaultEventLoopPolicy(BaseDefaultEventLoopPolicy):
|
||||||
if sys.version_info >= (3, 12):
|
if sys.version_info < (3, 14):
|
||||||
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
if sys.version_info >= (3, 12):
|
||||||
def get_child_watcher(self) -> AbstractChildWatcher: ...
|
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
||||||
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
def get_child_watcher(self) -> AbstractChildWatcher: ...
|
||||||
def set_child_watcher(self, watcher: AbstractChildWatcher | None) -> None: ...
|
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
||||||
else:
|
def set_child_watcher(self, watcher: AbstractChildWatcher | None) -> None: ...
|
||||||
def get_child_watcher(self) -> AbstractChildWatcher: ...
|
else:
|
||||||
def set_child_watcher(self, watcher: AbstractChildWatcher | None) -> None: ...
|
def get_child_watcher(self) -> AbstractChildWatcher: ...
|
||||||
|
def set_child_watcher(self, watcher: AbstractChildWatcher | None) -> None: ...
|
||||||
|
|
||||||
SelectorEventLoop = _UnixSelectorEventLoop
|
SelectorEventLoop = _UnixSelectorEventLoop
|
||||||
|
|
||||||
DefaultEventLoopPolicy = _UnixDefaultEventLoopPolicy
|
DefaultEventLoopPolicy = _UnixDefaultEventLoopPolicy
|
||||||
|
|
||||||
if sys.version_info >= (3, 12):
|
if sys.version_info < (3, 14):
|
||||||
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
if sys.version_info >= (3, 12):
|
||||||
class MultiLoopChildWatcher(AbstractChildWatcher):
|
@deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14")
|
||||||
def is_active(self) -> bool: ...
|
class MultiLoopChildWatcher(AbstractChildWatcher):
|
||||||
|
def is_active(self) -> bool: ...
|
||||||
|
def close(self) -> None: ...
|
||||||
|
def __enter__(self) -> Self: ...
|
||||||
|
def __exit__(
|
||||||
|
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None
|
||||||
|
) -> None: ...
|
||||||
|
def add_child_handler(
|
||||||
|
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
||||||
|
) -> None: ...
|
||||||
|
def remove_child_handler(self, pid: int) -> bool: ...
|
||||||
|
def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
|
||||||
|
|
||||||
|
else:
|
||||||
|
class MultiLoopChildWatcher(AbstractChildWatcher):
|
||||||
|
def is_active(self) -> bool: ...
|
||||||
|
def close(self) -> None: ...
|
||||||
|
def __enter__(self) -> Self: ...
|
||||||
|
def __exit__(
|
||||||
|
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None
|
||||||
|
) -> None: ...
|
||||||
|
def add_child_handler(
|
||||||
|
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
||||||
|
) -> None: ...
|
||||||
|
def remove_child_handler(self, pid: int) -> bool: ...
|
||||||
|
def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
|
||||||
|
|
||||||
|
if sys.version_info < (3, 14):
|
||||||
|
class ThreadedChildWatcher(AbstractChildWatcher):
|
||||||
|
def is_active(self) -> Literal[True]: ...
|
||||||
def close(self) -> None: ...
|
def close(self) -> None: ...
|
||||||
def __enter__(self) -> Self: ...
|
def __enter__(self) -> Self: ...
|
||||||
def __exit__(
|
def __exit__(
|
||||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None
|
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
def __del__(self) -> None: ...
|
||||||
def add_child_handler(
|
def add_child_handler(
|
||||||
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def remove_child_handler(self, pid: int) -> bool: ...
|
def remove_child_handler(self, pid: int) -> bool: ...
|
||||||
def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
|
def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
|
||||||
|
|
||||||
else:
|
if sys.version_info >= (3, 9):
|
||||||
class MultiLoopChildWatcher(AbstractChildWatcher):
|
class PidfdChildWatcher(AbstractChildWatcher):
|
||||||
def is_active(self) -> bool: ...
|
def __enter__(self) -> Self: ...
|
||||||
def close(self) -> None: ...
|
def __exit__(
|
||||||
def __enter__(self) -> Self: ...
|
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None
|
||||||
def __exit__(
|
) -> None: ...
|
||||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None
|
def is_active(self) -> bool: ...
|
||||||
) -> None: ...
|
def close(self) -> None: ...
|
||||||
def add_child_handler(
|
def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
|
||||||
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
def add_child_handler(
|
||||||
) -> None: ...
|
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
||||||
def remove_child_handler(self, pid: int) -> bool: ...
|
) -> None: ...
|
||||||
def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
|
def remove_child_handler(self, pid: int) -> bool: ...
|
||||||
|
|
||||||
class ThreadedChildWatcher(AbstractChildWatcher):
|
|
||||||
def is_active(self) -> Literal[True]: ...
|
|
||||||
def close(self) -> None: ...
|
|
||||||
def __enter__(self) -> Self: ...
|
|
||||||
def __exit__(
|
|
||||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None
|
|
||||||
) -> None: ...
|
|
||||||
def __del__(self) -> None: ...
|
|
||||||
def add_child_handler(
|
|
||||||
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
|
||||||
) -> None: ...
|
|
||||||
def remove_child_handler(self, pid: int) -> bool: ...
|
|
||||||
def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
|
|
||||||
|
|
||||||
if sys.version_info >= (3, 9):
|
|
||||||
class PidfdChildWatcher(AbstractChildWatcher):
|
|
||||||
def __enter__(self) -> Self: ...
|
|
||||||
def __exit__(
|
|
||||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None
|
|
||||||
) -> None: ...
|
|
||||||
def is_active(self) -> bool: ...
|
|
||||||
def close(self) -> None: ...
|
|
||||||
def attach_loop(self, loop: AbstractEventLoop | None) -> None: ...
|
|
||||||
def add_child_handler(
|
|
||||||
self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts]
|
|
||||||
) -> None: ...
|
|
||||||
def remove_child_handler(self, pid: int) -> bool: ...
|
|
||||||
|
|
|
@ -74,8 +74,9 @@ if sys.platform == "win32":
|
||||||
|
|
||||||
class WindowsSelectorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
|
class WindowsSelectorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
|
||||||
_loop_factory: ClassVar[type[SelectorEventLoop]]
|
_loop_factory: ClassVar[type[SelectorEventLoop]]
|
||||||
def get_child_watcher(self) -> NoReturn: ...
|
if sys.version_info < (3, 14):
|
||||||
def set_child_watcher(self, watcher: Any) -> NoReturn: ...
|
def get_child_watcher(self) -> NoReturn: ...
|
||||||
|
def set_child_watcher(self, watcher: Any) -> NoReturn: ...
|
||||||
|
|
||||||
class WindowsProactorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
|
class WindowsProactorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
|
||||||
_loop_factory: ClassVar[type[ProactorEventLoop]]
|
_loop_factory: ClassVar[type[ProactorEventLoop]]
|
||||||
|
|
|
@ -1673,9 +1673,9 @@ def pow(base: float, exp: complex | _SupportsSomeKindOfPow, mod: None = None) ->
|
||||||
@overload
|
@overload
|
||||||
def pow(base: complex, exp: complex | _SupportsSomeKindOfPow, mod: None = None) -> complex: ...
|
def pow(base: complex, exp: complex | _SupportsSomeKindOfPow, mod: None = None) -> complex: ...
|
||||||
@overload
|
@overload
|
||||||
def pow(base: _SupportsPow2[_E, _T_co], exp: _E, mod: None = None) -> _T_co: ...
|
def pow(base: _SupportsPow2[_E, _T_co], exp: _E, mod: None = None) -> _T_co: ... # type: ignore[overload-overlap]
|
||||||
@overload
|
@overload
|
||||||
def pow(base: _SupportsPow3NoneOnly[_E, _T_co], exp: _E, mod: None = None) -> _T_co: ...
|
def pow(base: _SupportsPow3NoneOnly[_E, _T_co], exp: _E, mod: None = None) -> _T_co: ... # type: ignore[overload-overlap]
|
||||||
@overload
|
@overload
|
||||||
def pow(base: _SupportsPow3[_E, _M, _T_co], exp: _E, mod: _M) -> _T_co: ...
|
def pow(base: _SupportsPow3[_E, _M, _T_co], exp: _E, mod: _M) -> _T_co: ...
|
||||||
@overload
|
@overload
|
||||||
|
|
|
@ -108,7 +108,7 @@ class _DefaultFactory(Protocol[_T_co]):
|
||||||
|
|
||||||
class Field(Generic[_T]):
|
class Field(Generic[_T]):
|
||||||
name: str
|
name: str
|
||||||
type: Type[_T]
|
type: Type[_T] | str | Any
|
||||||
default: _T | Literal[_MISSING_TYPE.MISSING]
|
default: _T | Literal[_MISSING_TYPE.MISSING]
|
||||||
default_factory: _DefaultFactory[_T] | Literal[_MISSING_TYPE.MISSING]
|
default_factory: _DefaultFactory[_T] | Literal[_MISSING_TYPE.MISSING]
|
||||||
repr: bool
|
repr: bool
|
||||||
|
|
|
@ -8,7 +8,7 @@ from string import Template
|
||||||
from time import struct_time
|
from time import struct_time
|
||||||
from types import FrameType, TracebackType
|
from types import FrameType, TracebackType
|
||||||
from typing import Any, ClassVar, Generic, Literal, Protocol, TextIO, TypeVar, overload
|
from typing import Any, ClassVar, Generic, Literal, Protocol, TextIO, TypeVar, overload
|
||||||
from typing_extensions import Self, TypeAlias
|
from typing_extensions import Self, TypeAlias, deprecated
|
||||||
|
|
||||||
if sys.version_info >= (3, 11):
|
if sys.version_info >= (3, 11):
|
||||||
from types import GenericAlias
|
from types import GenericAlias
|
||||||
|
@ -574,11 +574,8 @@ def disable(level: int = 50) -> None: ...
|
||||||
def addLevelName(level: int, levelName: str) -> None: ...
|
def addLevelName(level: int, levelName: str) -> None: ...
|
||||||
@overload
|
@overload
|
||||||
def getLevelName(level: int) -> str: ...
|
def getLevelName(level: int) -> str: ...
|
||||||
|
|
||||||
# The str -> int case is considered a mistake, but retained for backward
|
|
||||||
# compatibility. See
|
|
||||||
# https://docs.python.org/3/library/logging.html#logging.getLevelName.
|
|
||||||
@overload
|
@overload
|
||||||
|
@deprecated("The str -> int case is considered a mistake.")
|
||||||
def getLevelName(level: str) -> Any: ...
|
def getLevelName(level: str) -> Any: ...
|
||||||
|
|
||||||
if sys.version_info >= (3, 11):
|
if sys.version_info >= (3, 11):
|
||||||
|
|
|
@ -92,17 +92,21 @@ class BaseContext:
|
||||||
@overload
|
@overload
|
||||||
def Value(self, typecode_or_type: str | type[_CData], *args: Any, lock: bool | _LockLike = True) -> Any: ...
|
def Value(self, typecode_or_type: str | type[_CData], *args: Any, lock: bool | _LockLike = True) -> Any: ...
|
||||||
@overload
|
@overload
|
||||||
|
def Array(
|
||||||
|
self, typecode_or_type: type[_SimpleCData[_T]], size_or_initializer: int | Sequence[Any], *, lock: Literal[False]
|
||||||
|
) -> SynchronizedArray[_T]: ...
|
||||||
|
@overload
|
||||||
def Array(
|
def Array(
|
||||||
self, typecode_or_type: type[c_char], size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = True
|
self, typecode_or_type: type[c_char], size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = True
|
||||||
) -> SynchronizedString: ...
|
) -> SynchronizedString: ...
|
||||||
@overload
|
@overload
|
||||||
def Array(
|
def Array(
|
||||||
self, typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[False]
|
self,
|
||||||
) -> SynchronizedArray[_CT]: ...
|
typecode_or_type: type[_SimpleCData[_T]],
|
||||||
@overload
|
size_or_initializer: int | Sequence[Any],
|
||||||
def Array(
|
*,
|
||||||
self, typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = True
|
lock: Literal[True] | _LockLike = True,
|
||||||
) -> SynchronizedArray[_CT]: ...
|
) -> SynchronizedArray[_T]: ...
|
||||||
@overload
|
@overload
|
||||||
def Array(
|
def Array(
|
||||||
self, typecode_or_type: str, size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = True
|
self, typecode_or_type: str, size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = True
|
||||||
|
|
|
@ -39,12 +39,20 @@ def Array(
|
||||||
) -> _CT: ...
|
) -> _CT: ...
|
||||||
@overload
|
@overload
|
||||||
def Array(
|
def Array(
|
||||||
typecode_or_type: type[_CT],
|
typecode_or_type: type[c_char],
|
||||||
size_or_initializer: int | Sequence[Any],
|
size_or_initializer: int | Sequence[Any],
|
||||||
*,
|
*,
|
||||||
lock: Literal[True] | _LockLike = True,
|
lock: Literal[True] | _LockLike = True,
|
||||||
ctx: BaseContext | None = None,
|
ctx: BaseContext | None = None,
|
||||||
) -> SynchronizedArray[_CT]: ...
|
) -> SynchronizedString: ...
|
||||||
|
@overload
|
||||||
|
def Array(
|
||||||
|
typecode_or_type: type[_SimpleCData[_T]],
|
||||||
|
size_or_initializer: int | Sequence[Any],
|
||||||
|
*,
|
||||||
|
lock: Literal[True] | _LockLike = True,
|
||||||
|
ctx: BaseContext | None = None,
|
||||||
|
) -> SynchronizedArray[_T]: ...
|
||||||
@overload
|
@overload
|
||||||
def Array(
|
def Array(
|
||||||
typecode_or_type: str,
|
typecode_or_type: str,
|
||||||
|
@ -65,9 +73,11 @@ def copy(obj: _CT) -> _CT: ...
|
||||||
@overload
|
@overload
|
||||||
def synchronized(obj: _SimpleCData[_T], lock: _LockLike | None = None, ctx: Any | None = None) -> Synchronized[_T]: ...
|
def synchronized(obj: _SimpleCData[_T], lock: _LockLike | None = None, ctx: Any | None = None) -> Synchronized[_T]: ...
|
||||||
@overload
|
@overload
|
||||||
def synchronized(obj: ctypes.Array[c_char], lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedString: ...
|
def synchronized(obj: ctypes.Array[c_char], lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedString: ... # type: ignore
|
||||||
@overload
|
@overload
|
||||||
def synchronized(obj: ctypes.Array[_CT], lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedArray[_CT]: ...
|
def synchronized(
|
||||||
|
obj: ctypes.Array[_SimpleCData[_T]], lock: _LockLike | None = None, ctx: Any | None = None
|
||||||
|
) -> SynchronizedArray[_T]: ...
|
||||||
@overload
|
@overload
|
||||||
def synchronized(obj: _CT, lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedBase[_CT]: ...
|
def synchronized(obj: _CT, lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedBase[_CT]: ...
|
||||||
|
|
||||||
|
@ -89,19 +99,30 @@ class SynchronizedBase(Generic[_CT]):
|
||||||
class Synchronized(SynchronizedBase[_SimpleCData[_T]], Generic[_T]):
|
class Synchronized(SynchronizedBase[_SimpleCData[_T]], Generic[_T]):
|
||||||
value: _T
|
value: _T
|
||||||
|
|
||||||
class SynchronizedArray(SynchronizedBase[ctypes.Array[_CT]], Generic[_CT]):
|
class SynchronizedArray(SynchronizedBase[ctypes.Array[_SimpleCData[_T]]], Generic[_T]):
|
||||||
def __len__(self) -> int: ...
|
def __len__(self) -> int: ...
|
||||||
@overload
|
@overload
|
||||||
def __getitem__(self, i: slice) -> list[_CT]: ...
|
def __getitem__(self, i: slice) -> list[_T]: ...
|
||||||
@overload
|
@overload
|
||||||
def __getitem__(self, i: int) -> _CT: ...
|
def __getitem__(self, i: int) -> _T: ...
|
||||||
@overload
|
@overload
|
||||||
def __setitem__(self, i: slice, value: Iterable[_CT]) -> None: ...
|
def __setitem__(self, i: slice, value: Iterable[_T]) -> None: ...
|
||||||
@overload
|
@overload
|
||||||
def __setitem__(self, i: int, value: _CT) -> None: ...
|
def __setitem__(self, i: int, value: _T) -> None: ...
|
||||||
def __getslice__(self, start: int, stop: int) -> list[_CT]: ...
|
def __getslice__(self, start: int, stop: int) -> list[_T]: ...
|
||||||
def __setslice__(self, start: int, stop: int, values: Iterable[_CT]) -> None: ...
|
def __setslice__(self, start: int, stop: int, values: Iterable[_T]) -> None: ...
|
||||||
|
|
||||||
|
class SynchronizedString(SynchronizedArray[bytes]):
|
||||||
|
@overload # type: ignore[override]
|
||||||
|
def __getitem__(self, i: slice) -> bytes: ...
|
||||||
|
@overload # type: ignore[override]
|
||||||
|
def __getitem__(self, i: int) -> bytes: ...
|
||||||
|
@overload # type: ignore[override]
|
||||||
|
def __setitem__(self, i: slice, value: bytes) -> None: ...
|
||||||
|
@overload # type: ignore[override]
|
||||||
|
def __setitem__(self, i: int, value: bytes) -> None: ... # type: ignore[override]
|
||||||
|
def __getslice__(self, start: int, stop: int) -> bytes: ... # type: ignore[override]
|
||||||
|
def __setslice__(self, start: int, stop: int, values: bytes) -> None: ... # type: ignore[override]
|
||||||
|
|
||||||
class SynchronizedString(SynchronizedArray[c_char]):
|
|
||||||
value: bytes
|
value: bytes
|
||||||
raw: bytes
|
raw: bytes
|
||||||
|
|
|
@ -914,8 +914,8 @@ if sys.platform != "win32":
|
||||||
def forkpty() -> tuple[int, int]: ... # some flavors of Unix
|
def forkpty() -> tuple[int, int]: ... # some flavors of Unix
|
||||||
def killpg(pgid: int, signal: int, /) -> None: ...
|
def killpg(pgid: int, signal: int, /) -> None: ...
|
||||||
def nice(increment: int, /) -> int: ...
|
def nice(increment: int, /) -> int: ...
|
||||||
if sys.platform != "darwin":
|
if sys.platform != "darwin" and sys.platform != "linux":
|
||||||
def plock(op: int, /) -> None: ... # ???op is int?
|
def plock(op: int, /) -> None: ...
|
||||||
|
|
||||||
class _wrap_close(_TextIOWrapper):
|
class _wrap_close(_TextIOWrapper):
|
||||||
def __init__(self, stream: _TextIOWrapper, proc: Popen[str]) -> None: ...
|
def __init__(self, stream: _TextIOWrapper, proc: Popen[str]) -> None: ...
|
||||||
|
@ -1141,16 +1141,16 @@ if sys.version_info >= (3, 10) and sys.platform == "linux":
|
||||||
if sys.version_info >= (3, 12) and sys.platform == "linux":
|
if sys.version_info >= (3, 12) and sys.platform == "linux":
|
||||||
CLONE_FILES: int
|
CLONE_FILES: int
|
||||||
CLONE_FS: int
|
CLONE_FS: int
|
||||||
CLONE_NEWCGROUP: int
|
CLONE_NEWCGROUP: int # Linux 4.6+
|
||||||
CLONE_NEWIPC: int
|
CLONE_NEWIPC: int # Linux 2.6.19+
|
||||||
CLONE_NEWNET: int
|
CLONE_NEWNET: int # Linux 2.6.24+
|
||||||
CLONE_NEWNS: int
|
CLONE_NEWNS: int
|
||||||
CLONE_NEWPID: int
|
CLONE_NEWPID: int # Linux 3.8+
|
||||||
CLONE_NEWTIME: int
|
CLONE_NEWTIME: int # Linux 5.6+
|
||||||
CLONE_NEWUSER: int
|
CLONE_NEWUSER: int # Linux 3.8+
|
||||||
CLONE_NEWUTS: int
|
CLONE_NEWUTS: int # Linux 2.6.19+
|
||||||
CLONE_SIGHAND: int
|
CLONE_SIGHAND: int
|
||||||
CLONE_SYSVSEM: int
|
CLONE_SYSVSEM: int # Linux 2.6.26+
|
||||||
CLONE_THREAD: int
|
CLONE_THREAD: int
|
||||||
CLONE_VM: int
|
CLONE_VM: int
|
||||||
def unshare(flags: int) -> None: ...
|
def unshare(flags: int) -> None: ...
|
||||||
|
|
|
@ -77,11 +77,7 @@ pathsep: LiteralString
|
||||||
defpath: LiteralString
|
defpath: LiteralString
|
||||||
devnull: LiteralString
|
devnull: LiteralString
|
||||||
|
|
||||||
# Overloads are necessary to work around python/mypy#3644.
|
def abspath(path: PathLike[AnyStr] | AnyStr) -> AnyStr: ...
|
||||||
@overload
|
|
||||||
def abspath(path: PathLike[AnyStr]) -> AnyStr: ...
|
|
||||||
@overload
|
|
||||||
def abspath(path: AnyStr) -> AnyStr: ...
|
|
||||||
@overload
|
@overload
|
||||||
def basename(p: PathLike[AnyStr]) -> AnyStr: ...
|
def basename(p: PathLike[AnyStr]) -> AnyStr: ...
|
||||||
@overload
|
@overload
|
||||||
|
@ -90,14 +86,8 @@ def basename(p: AnyOrLiteralStr) -> AnyOrLiteralStr: ...
|
||||||
def dirname(p: PathLike[AnyStr]) -> AnyStr: ...
|
def dirname(p: PathLike[AnyStr]) -> AnyStr: ...
|
||||||
@overload
|
@overload
|
||||||
def dirname(p: AnyOrLiteralStr) -> AnyOrLiteralStr: ...
|
def dirname(p: AnyOrLiteralStr) -> AnyOrLiteralStr: ...
|
||||||
@overload
|
def expanduser(path: PathLike[AnyStr] | AnyStr) -> AnyStr: ...
|
||||||
def expanduser(path: PathLike[AnyStr]) -> AnyStr: ...
|
def expandvars(path: PathLike[AnyStr] | AnyStr) -> AnyStr: ...
|
||||||
@overload
|
|
||||||
def expanduser(path: AnyStr) -> AnyStr: ...
|
|
||||||
@overload
|
|
||||||
def expandvars(path: PathLike[AnyStr]) -> AnyStr: ...
|
|
||||||
@overload
|
|
||||||
def expandvars(path: AnyStr) -> AnyStr: ...
|
|
||||||
@overload
|
@overload
|
||||||
def normcase(s: PathLike[AnyStr]) -> AnyStr: ...
|
def normcase(s: PathLike[AnyStr]) -> AnyStr: ...
|
||||||
@overload
|
@overload
|
||||||
|
|
|
@ -36,6 +36,11 @@ if sys.platform != "win32":
|
||||||
def sp_expire(self) -> int: ...
|
def sp_expire(self) -> int: ...
|
||||||
@property
|
@property
|
||||||
def sp_flag(self) -> int: ...
|
def sp_flag(self) -> int: ...
|
||||||
|
# Deprecated aliases below.
|
||||||
|
@property
|
||||||
|
def sp_nam(self) -> str: ...
|
||||||
|
@property
|
||||||
|
def sp_pwd(self) -> str: ...
|
||||||
|
|
||||||
def getspall() -> list[struct_spwd]: ...
|
def getspall() -> list[struct_spwd]: ...
|
||||||
def getspnam(arg: str, /) -> struct_spwd: ...
|
def getspnam(arg: str, /) -> struct_spwd: ...
|
||||||
|
|
|
@ -889,6 +889,7 @@ if sys.version_info >= (3, 11):
|
||||||
start_new_session: bool = False,
|
start_new_session: bool = False,
|
||||||
pass_fds: Collection[int] = ...,
|
pass_fds: Collection[int] = ...,
|
||||||
*,
|
*,
|
||||||
|
encoding: str | None = None,
|
||||||
timeout: float | None = None,
|
timeout: float | None = None,
|
||||||
text: bool | None = None,
|
text: bool | None = None,
|
||||||
user: str | int | None = None,
|
user: str | int | None = None,
|
||||||
|
@ -920,6 +921,7 @@ elif sys.version_info >= (3, 10):
|
||||||
start_new_session: bool = False,
|
start_new_session: bool = False,
|
||||||
pass_fds: Collection[int] = ...,
|
pass_fds: Collection[int] = ...,
|
||||||
*,
|
*,
|
||||||
|
encoding: str | None = None,
|
||||||
timeout: float | None = None,
|
timeout: float | None = None,
|
||||||
text: bool | None = None,
|
text: bool | None = None,
|
||||||
user: str | int | None = None,
|
user: str | int | None = None,
|
||||||
|
@ -950,6 +952,7 @@ elif sys.version_info >= (3, 9):
|
||||||
start_new_session: bool = False,
|
start_new_session: bool = False,
|
||||||
pass_fds: Collection[int] = ...,
|
pass_fds: Collection[int] = ...,
|
||||||
*,
|
*,
|
||||||
|
encoding: str | None = None,
|
||||||
timeout: float | None = None,
|
timeout: float | None = None,
|
||||||
text: bool | None = None,
|
text: bool | None = None,
|
||||||
user: str | int | None = None,
|
user: str | int | None = None,
|
||||||
|
@ -978,6 +981,7 @@ else:
|
||||||
start_new_session: bool = False,
|
start_new_session: bool = False,
|
||||||
pass_fds: Collection[int] = ...,
|
pass_fds: Collection[int] = ...,
|
||||||
*,
|
*,
|
||||||
|
encoding: str | None = None,
|
||||||
timeout: float | None = None,
|
timeout: float | None = None,
|
||||||
text: bool | None = None,
|
text: bool | None = None,
|
||||||
) -> int: ...
|
) -> int: ...
|
||||||
|
@ -1005,6 +1009,7 @@ if sys.version_info >= (3, 11):
|
||||||
pass_fds: Collection[int] = ...,
|
pass_fds: Collection[int] = ...,
|
||||||
timeout: float | None = ...,
|
timeout: float | None = ...,
|
||||||
*,
|
*,
|
||||||
|
encoding: str | None = None,
|
||||||
text: bool | None = None,
|
text: bool | None = None,
|
||||||
user: str | int | None = None,
|
user: str | int | None = None,
|
||||||
group: str | int | None = None,
|
group: str | int | None = None,
|
||||||
|
@ -1036,6 +1041,7 @@ elif sys.version_info >= (3, 10):
|
||||||
pass_fds: Collection[int] = ...,
|
pass_fds: Collection[int] = ...,
|
||||||
timeout: float | None = ...,
|
timeout: float | None = ...,
|
||||||
*,
|
*,
|
||||||
|
encoding: str | None = None,
|
||||||
text: bool | None = None,
|
text: bool | None = None,
|
||||||
user: str | int | None = None,
|
user: str | int | None = None,
|
||||||
group: str | int | None = None,
|
group: str | int | None = None,
|
||||||
|
@ -1066,6 +1072,7 @@ elif sys.version_info >= (3, 9):
|
||||||
pass_fds: Collection[int] = ...,
|
pass_fds: Collection[int] = ...,
|
||||||
timeout: float | None = ...,
|
timeout: float | None = ...,
|
||||||
*,
|
*,
|
||||||
|
encoding: str | None = None,
|
||||||
text: bool | None = None,
|
text: bool | None = None,
|
||||||
user: str | int | None = None,
|
user: str | int | None = None,
|
||||||
group: str | int | None = None,
|
group: str | int | None = None,
|
||||||
|
@ -1094,6 +1101,7 @@ else:
|
||||||
pass_fds: Collection[int] = ...,
|
pass_fds: Collection[int] = ...,
|
||||||
timeout: float | None = ...,
|
timeout: float | None = ...,
|
||||||
*,
|
*,
|
||||||
|
encoding: str | None = None,
|
||||||
text: bool | None = None,
|
text: bool | None = None,
|
||||||
) -> int: ...
|
) -> int: ...
|
||||||
|
|
||||||
|
|
|
@ -103,10 +103,13 @@ PAX_NAME_FIELDS: set[str]
|
||||||
|
|
||||||
ENCODING: str
|
ENCODING: str
|
||||||
|
|
||||||
|
_FileCreationModes: TypeAlias = Literal["a", "w", "x"]
|
||||||
|
|
||||||
|
@overload
|
||||||
def open(
|
def open(
|
||||||
name: StrOrBytesPath | None = None,
|
name: StrOrBytesPath | None = None,
|
||||||
mode: str = "r",
|
mode: str = "r",
|
||||||
fileobj: IO[bytes] | None = None, # depends on mode
|
fileobj: IO[bytes] | None = None,
|
||||||
bufsize: int = 10240,
|
bufsize: int = 10240,
|
||||||
*,
|
*,
|
||||||
format: int | None = ...,
|
format: int | None = ...,
|
||||||
|
@ -121,6 +124,25 @@ def open(
|
||||||
compresslevel: int | None = ...,
|
compresslevel: int | None = ...,
|
||||||
preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...,
|
preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...,
|
||||||
) -> TarFile: ...
|
) -> TarFile: ...
|
||||||
|
@overload
|
||||||
|
def open(
|
||||||
|
name: StrOrBytesPath | None = None,
|
||||||
|
mode: _FileCreationModes = ...,
|
||||||
|
fileobj: _Fileobj | None = None,
|
||||||
|
bufsize: int = 10240,
|
||||||
|
*,
|
||||||
|
format: int | None = ...,
|
||||||
|
tarinfo: type[TarInfo] | None = ...,
|
||||||
|
dereference: bool | None = ...,
|
||||||
|
ignore_zeros: bool | None = ...,
|
||||||
|
encoding: str | None = ...,
|
||||||
|
errors: str = ...,
|
||||||
|
pax_headers: Mapping[str, str] | None = ...,
|
||||||
|
debug: int | None = ...,
|
||||||
|
errorlevel: int | None = ...,
|
||||||
|
compresslevel: int | None = ...,
|
||||||
|
preset: int | None = ...,
|
||||||
|
) -> TarFile: ...
|
||||||
|
|
||||||
class ExFileObject(io.BufferedReader):
|
class ExFileObject(io.BufferedReader):
|
||||||
def __init__(self, tarfile: TarFile, tarinfo: TarInfo) -> None: ...
|
def __init__(self, tarfile: TarFile, tarinfo: TarInfo) -> None: ...
|
||||||
|
|
|
@ -41,7 +41,10 @@ _P = ParamSpec("_P")
|
||||||
ProxyTypes: tuple[type[Any], ...]
|
ProxyTypes: tuple[type[Any], ...]
|
||||||
|
|
||||||
class WeakMethod(ref[_CallableT]):
|
class WeakMethod(ref[_CallableT]):
|
||||||
def __new__(cls, meth: _CallableT, callback: Callable[[Self], object] | None = None) -> Self: ...
|
# `ref` is implemented in `C` so positional-only arguments are enforced, but not in `WeakMethod`.
|
||||||
|
def __new__( # pyright: ignore[reportInconsistentConstructor]
|
||||||
|
cls, meth: _CallableT, callback: Callable[[Self], Any] | None = None
|
||||||
|
) -> Self: ...
|
||||||
def __call__(self) -> _CallableT | None: ...
|
def __call__(self) -> _CallableT | None: ...
|
||||||
def __eq__(self, other: object) -> bool: ...
|
def __eq__(self, other: object) -> bool: ...
|
||||||
def __ne__(self, other: object) -> bool: ...
|
def __ne__(self, other: object) -> bool: ...
|
||||||
|
|
|
@ -14,7 +14,7 @@ class ContentHandler:
|
||||||
def startDocument(self) -> None: ...
|
def startDocument(self) -> None: ...
|
||||||
def endDocument(self) -> None: ...
|
def endDocument(self) -> None: ...
|
||||||
def startPrefixMapping(self, prefix: str | None, uri: str) -> None: ...
|
def startPrefixMapping(self, prefix: str | None, uri: str) -> None: ...
|
||||||
def endPrefixMapping(self, prefix) -> None: ...
|
def endPrefixMapping(self, prefix: str | None) -> None: ...
|
||||||
def startElement(self, name: str, attrs: xmlreader.AttributesImpl) -> None: ...
|
def startElement(self, name: str, attrs: xmlreader.AttributesImpl) -> None: ...
|
||||||
def endElement(self, name: str) -> None: ...
|
def endElement(self, name: str) -> None: ...
|
||||||
def startElementNS(self, name: tuple[str, str], qname: str, attrs: xmlreader.AttributesNSImpl) -> None: ...
|
def startElementNS(self, name: tuple[str, str], qname: str, attrs: xmlreader.AttributesNSImpl) -> None: ...
|
||||||
|
|
|
@ -28,5 +28,7 @@ class zipimporter:
|
||||||
def is_package(self, fullname: str) -> bool: ...
|
def is_package(self, fullname: str) -> bool: ...
|
||||||
def load_module(self, fullname: str) -> ModuleType: ...
|
def load_module(self, fullname: str) -> ModuleType: ...
|
||||||
if sys.version_info >= (3, 10):
|
if sys.version_info >= (3, 10):
|
||||||
|
def exec_module(self, module: ModuleType) -> None: ...
|
||||||
|
def create_module(self, spec: ModuleSpec) -> None: ...
|
||||||
def find_spec(self, fullname: str, target: ModuleType | None = None) -> ModuleSpec | None: ...
|
def find_spec(self, fullname: str, target: ModuleType | None = None) -> ModuleSpec | None: ...
|
||||||
def invalidate_caches(self) -> None: ...
|
def invalidate_caches(self) -> None: ...
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue