mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Continuing work towards #8988. The first five commits were created using stubdefaulter on various Python versions; the following commits were all created manually by me to fix various problems. The main things this adds that weren't present in #9501 are: - Defaults in Windows-only modules and Windows-only branches (because I'm running a Windows machine) - Defaults in non-py311 branches - Defaults for float parameters - Defaults for overloads
36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
import sys
|
|
from _typeshed import Self, Unused
|
|
from collections.abc import Callable, Coroutine
|
|
from contextvars import Context
|
|
from typing import Any, TypeVar
|
|
from typing_extensions import final
|
|
|
|
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):
|
|
@final
|
|
class Runner:
|
|
def __init__(self, *, debug: bool | None = None, loop_factory: Callable[[], AbstractEventLoop] | None = None) -> None: ...
|
|
def __enter__(self: Self) -> Self: ...
|
|
def __exit__(self, exc_type: Unused, exc_val: Unused, exc_tb: Unused) -> None: ...
|
|
def close(self) -> None: ...
|
|
def get_loop(self) -> AbstractEventLoop: ...
|
|
def run(self, coro: Coroutine[Any, Any, _T], *, context: Context | None = None) -> _T: ...
|
|
|
|
if sys.version_info >= (3, 12):
|
|
def run(
|
|
main: Coroutine[Any, Any, _T], *, debug: bool | None = ..., loop_factory: Callable[[], AbstractEventLoop] | None = ...
|
|
) -> _T: ...
|
|
|
|
elif sys.version_info >= (3, 8):
|
|
def run(main: Coroutine[Any, Any, _T], *, debug: bool | None = None) -> _T: ...
|
|
|
|
else:
|
|
def run(main: Coroutine[Any, Any, _T], *, debug: bool = False) -> _T: ...
|