Remove Python 3.6 branches from typeshed (#8269)

This commit is contained in:
Alex Waygood
2022-07-11 09:55:17 +01:00
committed by GitHub
parent 29c17ffb47
commit edc0ecd857
114 changed files with 1016 additions and 2642 deletions

View File

@@ -12,18 +12,15 @@ if sys.version_info < (3, 8):
class InvalidStateError(Error): ...
if sys.version_info >= (3, 7):
from contextvars import Context
from contextvars import Context
if sys.version_info >= (3, 9):
from types import GenericAlias
if sys.version_info >= (3, 8):
__all__ = ("Future", "wrap_future", "isfuture")
elif sys.version_info >= (3, 7):
__all__ = ("CancelledError", "TimeoutError", "InvalidStateError", "Future", "wrap_future", "isfuture")
else:
__all__ = ["CancelledError", "TimeoutError", "InvalidStateError", "Future", "wrap_future", "isfuture"]
__all__ = ("CancelledError", "TimeoutError", "InvalidStateError", "Future", "wrap_future", "isfuture")
_T = TypeVar("_T")
@@ -32,15 +29,6 @@ _T = TypeVar("_T")
# That's why the import order is reversed.
def isfuture(obj: object) -> TypeGuard[Future[Any]]: ...
if sys.version_info < (3, 7):
class _TracebackLogger:
exc: BaseException
tb: list[str]
def __init__(self, exc: Any, loop: AbstractEventLoop) -> None: ...
def activate(self) -> None: ...
def clear(self) -> None: ...
def __del__(self) -> None: ...
class Future(Awaitable[_T], Iterable[_T]):
_state: str
@property
@@ -53,15 +41,10 @@ class Future(Awaitable[_T], Iterable[_T]):
_asyncio_future_blocking: bool # is a part of duck-typing contract for `Future`
def __init__(self, *, loop: AbstractEventLoop | None = ...) -> None: ...
def __del__(self) -> None: ...
if sys.version_info >= (3, 7):
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], Any], *, context: Context | None = ...) -> None: ...
else:
@property
def _callbacks(self: Self) -> list[Callable[[Self], Any]]: ...
def add_done_callback(self: Self, __fn: Callable[[Self], Any]) -> 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], Any], *, context: Context | None = ...) -> None: ...
if sys.version_info >= (3, 9):
def cancel(self, msg: Any | None = ...) -> bool: ...
else: