mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Add annotation for Future._callbacks (#2965)
This commit is contained in:
committed by
Sebastian Rittau
parent
b5493e8639
commit
8451cd7819
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user