From 4da20cb8b7d226b46d418ea24224e06435819496 Mon Sep 17 00:00:00 2001 From: Tuomas Suutari Date: Sat, 24 Mar 2018 17:15:39 +0200 Subject: [PATCH] multiprocessing: Fix timeout args of AsyncResult methods (#1984) The timeout argument of wait and get methods of AsyncResult accepts also None so fix the type specification to include Optional. Accepting None is not an implementation detail as it's clearly documented too: https://docs.python.org/2/library/multiprocessing.html#multiprocessing.pool.AsyncResult https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.AsyncResult --- stdlib/2/multiprocessing/pool.pyi | 4 ++-- stdlib/3/multiprocessing/pool.pyi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/2/multiprocessing/pool.pyi b/stdlib/2/multiprocessing/pool.pyi index e444240b4..57a628d33 100644 --- a/stdlib/2/multiprocessing/pool.pyi +++ b/stdlib/2/multiprocessing/pool.pyi @@ -8,8 +8,8 @@ from typing import ( _T = TypeVar('_T', bound='Pool') class AsyncResult(): - def get(self, timeout: float = ...) -> Any: ... - def wait(self, timeout: float = ...) -> None: ... + def get(self, timeout: Optional[float] = ...) -> Any: ... + def wait(self, timeout: Optional[float] = ...) -> None: ... def ready(self) -> bool: ... def successful(self) -> bool: ... diff --git a/stdlib/3/multiprocessing/pool.pyi b/stdlib/3/multiprocessing/pool.pyi index 311f900d5..c641e141a 100644 --- a/stdlib/3/multiprocessing/pool.pyi +++ b/stdlib/3/multiprocessing/pool.pyi @@ -10,8 +10,8 @@ from typing import ( _T = TypeVar('_T', bound='Pool') class AsyncResult(): - def get(self, timeout: float = ...) -> Any: ... - def wait(self, timeout: float = ...) -> None: ... + def get(self, timeout: Optional[float] = ...) -> Any: ... + def wait(self, timeout: Optional[float] = ...) -> None: ... def ready(self) -> bool: ... def successful(self) -> bool: ...