Skip to content

Commit 83fbb49

Browse files
committed
restore missing uvloop members to uvloop typing
1 parent 5ddf38b commit 83fbb49

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

uvloop/__init__.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import asyncio as __asyncio
24
import typing as _typing
35
import sys as _sys
@@ -9,10 +11,12 @@
911
from .loop import Loop as __BaseLoop # NOQA
1012
from ._version import __version__ # NOQA
1113

12-
1314
__all__ = ('new_event_loop', 'install', 'EventLoopPolicy')
1415

1516

17+
_T = TypeVar("_T")
18+
19+
1620
class Loop(__BaseLoop, __asyncio.AbstractEventLoop): # type: ignore[misc]
1721
pass
1822

@@ -34,6 +38,15 @@ def install() -> None:
3438
__asyncio.set_event_loop_policy(EventLoopPolicy())
3539

3640

41+
@_typing.overload
42+
def run(
43+
main: _typing.Coroutine[_typing.Any, _typing.Any, _T],
44+
*,
45+
debug: bool | None = ...,
46+
loop_factory: _typing.Callable[[], __asyncio.AbstractEventLoop] | None = ...,
47+
) -> _T: ...
48+
49+
3750
def run(main, *, loop_factory=new_event_loop, debug=None, **run_kwargs):
3851
"""The preferred way of running a coroutine with uvloop."""
3952

uvloop/__init__.pyi

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)