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
2018-03-24 17:15:39 +02:00
committed by Jelle Zijlstra
parent eb571e9cbb
commit 4da20cb8b7
2 changed files with 4 additions and 4 deletions

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: ...

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: ...