Add annotation for Future._callbacks (#2965)

This commit is contained in:
Mark Vismonte authored and Sebastian Rittau committed 2019-05-07 18:02:41 +02:00
1 parent b5493e8639
commit 8451cd7819
1 file changed
+8 -1
+8 -1
View File
@@ -1,5 +1,5 @@
import sys
from typing import Any, Union, Callable, TypeVar, Type, List, Generic, Iterable, Generator, Awaitable, Optional
from typing import Any, Union, Callable, TypeVar, Type, List, Generic, Iterable, Generator, Awaitable, Optional, Tuple
from .events import AbstractEventLoop
from concurrent.futures import (
CancelledError as CancelledError,
@@ -8,6 +8,9 @@ from concurrent.futures import (
Error,
)
if sys.version_info >= (3, 7):
from contextvars import Context
__all__: List[str]
_T = TypeVar('_T')
@@ -37,6 +40,10 @@ class Future(Awaitable[_T], Iterable[_T]):
def __del__(self) -> None: ...
if sys.version_info >= (3, 7):
def get_loop(self) -> AbstractEventLoop: ...
def _callbacks(self: _S) -> List[Tuple[Callable[[_S], Any], Context]]: ...
else:
@property
def _callbacks(self: _S) -> List[Callable[[_S], Any]]: ...
def cancel(self) -> bool: ...
def _schedule_callbacks(self) -> None: ...
def cancelled(self) -> bool: ...