Files
typeshed/stdlib/asyncio/runners.pyi
Jelle Zijlstra eab82c838a asyncio: updates for 3.11 (#7844)
CPython changes:

- 13c10bfb77
- 9523c0d84f
- 9f04ee569c
- d03acd7270
- 195a46d6ff

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-05-17 18:11:29 -07:00

29 lines
1006 B
Python

import sys
from _typeshed import Self
from collections.abc import Callable, Coroutine
from contextvars import Context
from typing import Any, TypeVar
from .events import AbstractEventLoop
if sys.version_info >= (3, 11):
__all__ = ("Runner", "run")
else:
__all__ = ("run",)
_T = TypeVar("_T")
if sys.version_info >= (3, 11):
class Runner:
def __init__(self, *, debug: bool | None = ..., loop_factory: Callable[[], AbstractEventLoop] | None = ...) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, exc_type: object, exc_val: object, exc_tb: object) -> None: ...
def close(self) -> None: ...
def get_loop(self) -> AbstractEventLoop: ...
def run(self, coro: Coroutine[Any, Any, _T], *, context: Context | None = ...) -> _T: ...
if sys.version_info >= (3, 8):
def run(main: Coroutine[Any, Any, _T], *, debug: bool | None = ...) -> _T: ...
else:
def run(main: Coroutine[Any, Any, _T], *, debug: bool = ...) -> _T: ...