Skip to content

Commit cc394ea

Browse files
committed
Fixed typing for coroutines.
1 parent 34b0b00 commit cc394ea

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

taskiq_dependencies/dependency.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import inspect
22
import uuid
3+
from collections.abc import Coroutine
34
from contextlib import _AsyncGeneratorContextManager, _GeneratorContextManager
5+
from types import CoroutineType
46
from typing import (
57
Any,
68
AsyncGenerator,
79
Callable,
8-
Coroutine,
910
Dict,
1011
Generator,
1112
Optional,
@@ -68,6 +69,16 @@ def Depends(
6869
...
6970

7071

72+
@overload
73+
def Depends(
74+
dependency: Optional[Callable[..., CoroutineType[Any, Any, _T]]] = None,
75+
*,
76+
use_cache: bool = True,
77+
kwargs: Optional[Dict[str, Any]] = None,
78+
) -> _T: # pragma: no cover
79+
...
80+
81+
7182
@overload
7283
def Depends(
7384
dependency: Optional[Callable[..., Coroutine[Any, Any, _T]]] = None,

0 commit comments

Comments
 (0)