Add annotation for Future._callbacks (#2965)

This commit is contained in:
Mark Vismonte
2019-05-07 12:02:41 -04:00
committed by Sebastian Rittau
parent b5493e8639
commit 8451cd7819

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