Update to Python 3.9.10 and 3.10.2 (#6977)

This commit is contained in:
Sebastian Rittau
2022-02-12 02:37:31 +01:00
committed by GitHub
parent 7e5f3c38bd
commit 92685d18f7
4 changed files with 45 additions and 14 deletions

View File

@@ -89,12 +89,25 @@ class AbstractEventLoop(metaclass=ABCMeta):
@abstractmethod
async def shutdown_asyncgens(self) -> None: ...
# Methods scheduling callbacks. All these return Handles.
@abstractmethod
def call_soon(self, callback: Callable[..., Any], *args: Any) -> Handle: ...
@abstractmethod
def call_later(self, delay: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ...
@abstractmethod
def call_at(self, when: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ...
if sys.version_info >= (3, 9): # "context" added in 3.9.10/3.10.2
@abstractmethod
def call_soon(self, callback: Callable[..., Any], *args: Any, context: Context | None = ...) -> Handle: ...
@abstractmethod
def call_later(
self, delay: float, callback: Callable[..., Any], *args: Any, context: Context | None = ...
) -> TimerHandle: ...
@abstractmethod
def call_at(
self, when: float, callback: Callable[..., Any], *args: Any, context: Context | None = ...
) -> TimerHandle: ...
else:
@abstractmethod
def call_soon(self, callback: Callable[..., Any], *args: Any) -> Handle: ...
@abstractmethod
def call_later(self, delay: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ...
@abstractmethod
def call_at(self, when: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ...
@abstractmethod
def time(self) -> float: ...
# Future methods
@@ -115,8 +128,13 @@ class AbstractEventLoop(metaclass=ABCMeta):
@abstractmethod
def get_task_factory(self) -> Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]] | None: ...
# Methods for interacting with threads
@abstractmethod
def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any) -> Handle: ...
if sys.version_info >= (3, 9): # "context" added in 3.9.10/3.10.2
@abstractmethod
def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any, context: Context | None = ...) -> Handle: ...
else:
@abstractmethod
def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any) -> Handle: ...
@abstractmethod
def run_in_executor(self, executor: Any, func: Callable[..., _T], *args: Any) -> Future[_T]: ...
@abstractmethod