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
This commit is contained in:
Tuomas Suutari authored and Jelle Zijlstra committed 2018-03-24 08:15:39 -07:00
1 parent eb571e9cbb
commit 4da20cb8b7
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -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: ...
+2 -2
View File
@@ -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: ...