mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
Use typing_extensions.Self in the stdlib (#9694)
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from collections.abc import Awaitable, Callable, Generator, Iterable
|
||||
from concurrent.futures._base import Error, Future as _ConcurrentFuture
|
||||
from typing import Any, TypeVar
|
||||
from typing_extensions import Literal, TypeGuard
|
||||
from typing_extensions import Literal, Self, TypeGuard
|
||||
|
||||
from .events import AbstractEventLoop
|
||||
|
||||
@@ -43,8 +42,8 @@ class Future(Awaitable[_T], Iterable[_T]):
|
||||
def __del__(self) -> None: ...
|
||||
def get_loop(self) -> AbstractEventLoop: ...
|
||||
@property
|
||||
def _callbacks(self: Self) -> list[tuple[Callable[[Self], Any], Context]]: ...
|
||||
def add_done_callback(self: Self, __fn: Callable[[Self], object], *, context: Context | None = None) -> None: ...
|
||||
def _callbacks(self) -> list[tuple[Callable[[Self], Any], Context]]: ...
|
||||
def add_done_callback(self, __fn: Callable[[Self], object], *, context: Context | None = None) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def cancel(self, msg: Any | None = None) -> bool: ...
|
||||
else:
|
||||
@@ -54,7 +53,7 @@ class Future(Awaitable[_T], Iterable[_T]):
|
||||
def done(self) -> bool: ...
|
||||
def result(self) -> _T: ...
|
||||
def exception(self) -> BaseException | None: ...
|
||||
def remove_done_callback(self: Self, __fn: Callable[[Self], object]) -> int: ...
|
||||
def remove_done_callback(self, __fn: Callable[[Self], object]) -> int: ...
|
||||
def set_result(self, __result: _T) -> None: ...
|
||||
def set_exception(self, __exception: type | BaseException) -> None: ...
|
||||
def __iter__(self) -> Generator[Any, None, _T]: ...
|
||||
|
||||
Reference in New Issue
Block a user