mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
Add more defaults to the stdlib (#9606)
Continuing work towards #8988. The first five commits were created using stubdefaulter on various Python versions; the following commits were all created manually by me to fix various problems. The main things this adds that weren't present in #9501 are: - Defaults in Windows-only modules and Windows-only branches (because I'm running a Windows machine) - Defaults in non-py311 branches - Defaults for float parameters - Defaults for overloads
This commit is contained in:
@@ -60,7 +60,7 @@ class Executor:
|
||||
if sys.version_info >= (3, 9):
|
||||
def shutdown(self, wait: bool = True, *, cancel_futures: bool = False) -> None: ...
|
||||
else:
|
||||
def shutdown(self, wait: bool = ...) -> None: ...
|
||||
def shutdown(self, wait: bool = True) -> None: ...
|
||||
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
|
||||
@@ -58,7 +58,7 @@ class _ResultItem:
|
||||
self, work_id: int, exception: Exception | None = None, result: Any | None = None, exit_pid: int | None = None
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, work_id: int, exception: Exception | None = ..., result: Any | None = ...) -> None: ...
|
||||
def __init__(self, work_id: int, exception: Exception | None = None, result: Any | None = None) -> None: ...
|
||||
|
||||
class _CallItem:
|
||||
work_id: int
|
||||
@@ -83,7 +83,7 @@ class _SafeQueue(Queue[Future[Any]]):
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
self, max_size: int | None = ..., *, ctx: BaseContext, pending_work_items: dict[int, _WorkItem[Any]]
|
||||
self, max_size: int | None = 0, *, ctx: BaseContext, pending_work_items: dict[int, _WorkItem[Any]]
|
||||
) -> None: ...
|
||||
|
||||
def _on_queue_feeder_error(self, e: Exception, obj: _CallItem) -> None: ...
|
||||
@@ -102,7 +102,7 @@ if sys.version_info >= (3, 11):
|
||||
|
||||
else:
|
||||
def _sendback_result(
|
||||
result_queue: SimpleQueue[_WorkItem[Any]], work_id: int, result: Any | None = ..., exception: Exception | None = ...
|
||||
result_queue: SimpleQueue[_WorkItem[Any]], work_id: int, result: Any | None = None, exception: Exception | None = None
|
||||
) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
@@ -181,9 +181,9 @@ class ProcessPoolExecutor(Executor):
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
max_workers: int | None = ...,
|
||||
mp_context: BaseContext | None = ...,
|
||||
initializer: Callable[..., object] | None = ...,
|
||||
max_workers: int | None = None,
|
||||
mp_context: BaseContext | None = None,
|
||||
initializer: Callable[..., object] | None = None,
|
||||
initargs: tuple[Any, ...] = ...,
|
||||
) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
|
||||
Reference in New Issue
Block a user