mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Remove Python 3.7 branches (#11238)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import sys
|
||||
from multiprocessing import context, reduction as reducer
|
||||
from multiprocessing.context import (
|
||||
AuthenticationError as AuthenticationError,
|
||||
@@ -7,7 +6,11 @@ from multiprocessing.context import (
|
||||
ProcessError as ProcessError,
|
||||
TimeoutError as TimeoutError,
|
||||
)
|
||||
from multiprocessing.process import active_children as active_children, current_process as current_process
|
||||
from multiprocessing.process import (
|
||||
active_children as active_children,
|
||||
current_process as current_process,
|
||||
parent_process as parent_process,
|
||||
)
|
||||
|
||||
# These are technically functions that return instances of these Queue classes.
|
||||
# The stub here doesn't reflect reality exactly --
|
||||
@@ -19,9 +22,6 @@ from multiprocessing.process import active_children as active_children, current_
|
||||
from multiprocessing.queues import JoinableQueue as JoinableQueue, Queue as Queue, SimpleQueue as SimpleQueue
|
||||
from multiprocessing.spawn import freeze_support as freeze_support
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from multiprocessing.process import parent_process as parent_process
|
||||
|
||||
__all__ = [
|
||||
"Array",
|
||||
"AuthenticationError",
|
||||
@@ -55,15 +55,13 @@ __all__ = [
|
||||
"get_logger",
|
||||
"get_start_method",
|
||||
"log_to_stderr",
|
||||
"parent_process",
|
||||
"reducer",
|
||||
"set_executable",
|
||||
"set_forkserver_preload",
|
||||
"set_start_method",
|
||||
]
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
__all__ += ["parent_process"]
|
||||
|
||||
# These functions (really bound methods)
|
||||
# are all autogenerated at runtime here: https://github.com/python/cpython/blob/600c65c094b0b48704d8ec2416930648052ba715/Lib/multiprocessing/__init__.py#L23
|
||||
RawValue = context._default_context.RawValue
|
||||
|
||||
@@ -16,10 +16,7 @@ if sys.platform != "win32":
|
||||
else:
|
||||
from multiprocessing.connection import PipeConnection
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
__all__ = ()
|
||||
else:
|
||||
__all__: list[str] = []
|
||||
__all__ = ()
|
||||
|
||||
_LockLike: TypeAlias = synchronize.Lock | synchronize.RLock
|
||||
_CT = TypeVar("_CT", bound=_CData)
|
||||
@@ -39,10 +36,8 @@ class BaseContext:
|
||||
# multiprocessing.*, so the signatures should be identical (modulo self).
|
||||
@staticmethod
|
||||
def current_process() -> BaseProcess: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
@staticmethod
|
||||
def parent_process() -> BaseProcess | None: ...
|
||||
|
||||
@staticmethod
|
||||
def parent_process() -> BaseProcess | None: ...
|
||||
@staticmethod
|
||||
def active_children() -> list[BaseProcess]: ...
|
||||
def cpu_count(self) -> int: ...
|
||||
@@ -151,8 +146,6 @@ class DefaultContext(BaseContext):
|
||||
def __init__(self, context: BaseContext) -> None: ...
|
||||
def get_start_method(self, allow_none: bool = False) -> str: ...
|
||||
def get_all_start_methods(self) -> list[str]: ...
|
||||
if sys.version_info < (3, 8):
|
||||
__all__: ClassVar[list[str]]
|
||||
|
||||
_default_context: DefaultContext
|
||||
|
||||
|
||||
@@ -9,14 +9,9 @@ from typing_extensions import Self, SupportsIndex, TypeAlias
|
||||
|
||||
from .connection import Connection
|
||||
from .context import BaseContext
|
||||
from .shared_memory import _SLT, ShareableList as _ShareableList, SharedMemory as _SharedMemory
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from .shared_memory import _SLT, ShareableList as _ShareableList, SharedMemory as _SharedMemory
|
||||
|
||||
__all__ = ["BaseManager", "SyncManager", "BaseProxy", "Token", "SharedMemoryManager"]
|
||||
|
||||
else:
|
||||
__all__ = ["BaseManager", "SyncManager", "BaseProxy", "Token"]
|
||||
__all__ = ["BaseManager", "SyncManager", "BaseProxy", "Token", "SharedMemoryManager"]
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
@@ -208,12 +203,10 @@ class SyncManager(BaseManager):
|
||||
def list(self) -> ListProxy[Any]: ...
|
||||
|
||||
class RemoteError(Exception): ...
|
||||
class SharedMemoryServer(Server): ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
class SharedMemoryServer(Server): ...
|
||||
|
||||
class SharedMemoryManager(BaseManager):
|
||||
def get_server(self) -> SharedMemoryServer: ...
|
||||
def SharedMemory(self, size: int) -> _SharedMemory: ...
|
||||
def ShareableList(self, sequence: Iterable[_SLT] | None) -> _ShareableList[_SLT]: ...
|
||||
def __del__(self) -> None: ...
|
||||
class SharedMemoryManager(BaseManager):
|
||||
def get_server(self) -> SharedMemoryServer: ...
|
||||
def SharedMemory(self, size: int) -> _SharedMemory: ...
|
||||
def ShareableList(self, sequence: Iterable[_SLT] | None) -> _ShareableList[_SLT]: ...
|
||||
def __del__(self) -> None: ...
|
||||
|
||||
@@ -13,18 +13,9 @@ _S = TypeVar("_S")
|
||||
_T = TypeVar("_T")
|
||||
|
||||
class ApplyResult(Generic[_T]):
|
||||
if sys.version_info >= (3, 8):
|
||||
def __init__(
|
||||
self, pool: Pool, callback: Callable[[_T], object] | None, error_callback: Callable[[BaseException], object] | None
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
cache: dict[int, ApplyResult[Any]],
|
||||
callback: Callable[[_T], object] | None,
|
||||
error_callback: Callable[[BaseException], object] | None,
|
||||
) -> None: ...
|
||||
|
||||
def __init__(
|
||||
self, pool: Pool, callback: Callable[[_T], object] | None, error_callback: Callable[[BaseException], object] | None
|
||||
) -> None: ...
|
||||
def get(self, timeout: float | None = None) -> _T: ...
|
||||
def wait(self, timeout: float | None = None) -> None: ...
|
||||
def ready(self) -> bool: ...
|
||||
@@ -36,31 +27,17 @@ class ApplyResult(Generic[_T]):
|
||||
AsyncResult = ApplyResult
|
||||
|
||||
class MapResult(ApplyResult[list[_T]]):
|
||||
if sys.version_info >= (3, 8):
|
||||
def __init__(
|
||||
self,
|
||||
pool: Pool,
|
||||
chunksize: int,
|
||||
length: int,
|
||||
callback: Callable[[list[_T]], object] | None,
|
||||
error_callback: Callable[[BaseException], object] | None,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
cache: dict[int, ApplyResult[Any]],
|
||||
chunksize: int,
|
||||
length: int,
|
||||
callback: Callable[[list[_T]], object] | None,
|
||||
error_callback: Callable[[BaseException], object] | None,
|
||||
) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
pool: Pool,
|
||||
chunksize: int,
|
||||
length: int,
|
||||
callback: Callable[[list[_T]], object] | None,
|
||||
error_callback: Callable[[BaseException], object] | None,
|
||||
) -> None: ...
|
||||
|
||||
class IMapIterator(Iterator[_T]):
|
||||
if sys.version_info >= (3, 8):
|
||||
def __init__(self, pool: Pool) -> None: ...
|
||||
else:
|
||||
def __init__(self, cache: dict[int, IMapIterator[Any]]) -> None: ...
|
||||
|
||||
def __init__(self, pool: Pool) -> None: ...
|
||||
def __iter__(self) -> Self: ...
|
||||
def next(self, timeout: float | None = None) -> _T: ...
|
||||
def __next__(self, timeout: float | None = None) -> _T: ...
|
||||
@@ -120,12 +97,7 @@ class ThreadPool(Pool):
|
||||
) -> None: ...
|
||||
|
||||
# undocumented
|
||||
if sys.version_info >= (3, 8):
|
||||
INIT: Literal["INIT"]
|
||||
RUN: Literal["RUN"]
|
||||
CLOSE: Literal["CLOSE"]
|
||||
TERMINATE: Literal["TERMINATE"]
|
||||
else:
|
||||
RUN: Literal[0]
|
||||
CLOSE: Literal[1]
|
||||
TERMINATE: Literal[2]
|
||||
INIT: Literal["INIT"]
|
||||
RUN: Literal["RUN"]
|
||||
CLOSE: Literal["CLOSE"]
|
||||
TERMINATE: Literal["TERMINATE"]
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
import sys
|
||||
from collections.abc import Callable, Iterable, Mapping
|
||||
from typing import Any
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
__all__ = ["BaseProcess", "current_process", "active_children", "parent_process"]
|
||||
else:
|
||||
__all__ = ["BaseProcess", "current_process", "active_children"]
|
||||
__all__ = ["BaseProcess", "current_process", "active_children", "parent_process"]
|
||||
|
||||
class BaseProcess:
|
||||
name: str
|
||||
@@ -40,6 +36,4 @@ class BaseProcess:
|
||||
|
||||
def current_process() -> BaseProcess: ...
|
||||
def active_children() -> list[BaseProcess]: ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
def parent_process() -> BaseProcess | None: ...
|
||||
def parent_process() -> BaseProcess | None: ...
|
||||
|
||||
@@ -32,13 +32,9 @@ register = ForkingPickler.register
|
||||
def dump(obj: Any, file: SupportsWrite[bytes], protocol: int | None = None) -> None: ...
|
||||
|
||||
if sys.platform == "win32":
|
||||
if sys.version_info >= (3, 8):
|
||||
def duplicate(
|
||||
handle: int, target_process: int | None = None, inheritable: bool = False, *, source_process: int | None = None
|
||||
) -> int: ...
|
||||
else:
|
||||
def duplicate(handle: int, target_process: int | None = None, inheritable: bool = False) -> int: ...
|
||||
|
||||
def duplicate(
|
||||
handle: int, target_process: int | None = None, inheritable: bool = False, *, source_process: int | None = None
|
||||
) -> int: ...
|
||||
def steal_handle(source_pid: int, handle: int) -> int: ...
|
||||
def send_handle(conn: connection.PipeConnection, handle: int, destination_pid: int) -> None: ...
|
||||
def recv_handle(conn: connection.PipeConnection) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user