Stdlib: add container default values (#9909)

This commit is contained in:
Alex Waygood
2023-03-21 08:12:34 +00:00
committed by GitHub
parent 151159709d
commit dd2818a41d
66 changed files with 246 additions and 242 deletions

View File

@@ -72,7 +72,7 @@ class BaseContext:
self,
processes: int | None = None,
initializer: Callable[..., object] | None = None,
initargs: Iterable[Any] = ...,
initargs: Iterable[Any] = (),
maxtasksperchild: int | None = None,
) -> _Pool: ...
@overload

View File

@@ -50,8 +50,8 @@ class DummyProcess(threading.Thread):
group: Any = None,
target: Callable[..., object] | None = None,
name: str | None = None,
args: Iterable[Any] = ...,
kwargs: Mapping[str, Any] = ...,
args: Iterable[Any] = (),
kwargs: Mapping[str, Any] = {},
) -> None: ...
Process = DummyProcess
@@ -69,9 +69,7 @@ class Value:
def Array(typecode: Any, sequence: Sequence[Any], lock: Any = True) -> array.array[Any]: ...
def Manager() -> Any: ...
def Pool(
processes: int | None = None, initializer: Callable[..., object] | None = None, initargs: Iterable[Any] = ...
) -> Any: ...
def Pool(processes: int | None = None, initializer: Callable[..., object] | None = None, initargs: Iterable[Any] = ()) -> Any: ...
def active_children() -> list[Any]: ...
current_process = threading.current_thread

View File

@@ -54,7 +54,7 @@ class BaseProxy:
manager_owned: bool = False,
) -> None: ...
def __deepcopy__(self, memo: Any | None) -> Any: ...
def _callmethod(self, methodname: str, args: tuple[Any, ...] = ..., kwds: dict[Any, Any] = ...) -> None: ...
def _callmethod(self, methodname: str, args: tuple[Any, ...] = (), kwds: dict[Any, Any] = {}) -> None: ...
def _getvalue(self) -> Any: ...
def __reduce__(self) -> tuple[Any, tuple[Any, Any, str, dict[Any, Any]]]: ...
@@ -150,7 +150,7 @@ class BaseManager:
def get_server(self) -> Server: ...
def connect(self) -> None: ...
def start(self, initializer: Callable[..., object] | None = None, initargs: Iterable[Any] = ...) -> None: ...
def start(self, initializer: Callable[..., object] | None = None, initargs: Iterable[Any] = ()) -> None: ...
def shutdown(self) -> None: ... # only available after start() was called
def join(self, timeout: float | None = None) -> None: ... # undocumented
@property

View File

@@ -72,16 +72,16 @@ class Pool:
self,
processes: int | None = None,
initializer: Callable[..., object] | None = None,
initargs: Iterable[Any] = ...,
initargs: Iterable[Any] = (),
maxtasksperchild: int | None = None,
context: Any | None = None,
) -> None: ...
def apply(self, func: Callable[..., _T], args: Iterable[Any] = ..., kwds: Mapping[str, Any] = ...) -> _T: ...
def apply(self, func: Callable[..., _T], args: Iterable[Any] = (), kwds: Mapping[str, Any] = {}) -> _T: ...
def apply_async(
self,
func: Callable[..., _T],
args: Iterable[Any] = ...,
kwds: Mapping[str, Any] = ...,
args: Iterable[Any] = (),
kwds: Mapping[str, Any] = {},
callback: Callable[[_T], object] | None = None,
error_callback: Callable[[BaseException], object] | None = None,
) -> AsyncResult[_T]: ...
@@ -115,7 +115,7 @@ class Pool:
class ThreadPool(Pool):
def __init__(
self, processes: int | None = None, initializer: Callable[..., object] | None = None, initargs: Iterable[Any] = ...
self, processes: int | None = None, initializer: Callable[..., object] | None = None, initargs: Iterable[Any] = ()
) -> None: ...
# undocumented

View File

@@ -17,8 +17,8 @@ class BaseProcess:
group: None = None,
target: Callable[..., object] | None = None,
name: str | None = None,
args: Iterable[Any] = ...,
kwargs: Mapping[str, Any] = ...,
args: Iterable[Any] = (),
kwargs: Mapping[str, Any] = {},
*,
daemon: bool | None = None,
) -> None: ...

View File

@@ -50,14 +50,14 @@ class Finalize:
self,
obj: Incomplete | None,
callback: Callable[..., Incomplete],
args: Sequence[Any] = ...,
args: Sequence[Any] = (),
kwargs: Mapping[str, Any] | None = None,
exitpriority: int | None = None,
) -> None: ...
def __call__(
self,
wr: Unused = None,
_finalizer_registry: MutableMapping[Incomplete, Incomplete] = ...,
_finalizer_registry: MutableMapping[Incomplete, Incomplete] = {},
sub_debug: Callable[..., object] = ...,
getpid: Callable[[], int] = ...,
) -> Incomplete: ...