mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Change return type of Future.exception to be Optional[BaseException] (#3849)
Future.exception can return None if no exception was capture in the future. As documented: https://docs.python.org/3/library/asyncio-future.html#asyncio.Future.exception
This commit is contained in:
@@ -51,7 +51,7 @@ class Future(Awaitable[_T], Iterable[_T]):
|
||||
def cancelled(self) -> bool: ...
|
||||
def done(self) -> bool: ...
|
||||
def result(self) -> _T: ...
|
||||
def exception(self) -> BaseException: ...
|
||||
def exception(self) -> Optional[BaseException]: ...
|
||||
def remove_done_callback(self: _S, fn: Callable[[_S], Any]) -> int: ...
|
||||
def set_result(self, result: _T) -> None: ...
|
||||
def set_exception(self, exception: Union[type, BaseException]) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user