mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2025-08-15 11:11:16 +08:00
Fix #922: allow DependencyCallable type to be generators
This commit is contained in:
@ -1,7 +1,13 @@
|
|||||||
from typing import Callable, Coroutine, TypeVar, Union
|
from typing import AsyncGenerator, Callable, Coroutine, Generator, TypeVar, Union
|
||||||
|
|
||||||
RETURN_TYPE = TypeVar("RETURN_TYPE")
|
RETURN_TYPE = TypeVar("RETURN_TYPE")
|
||||||
|
|
||||||
DependencyCallable = Callable[
|
DependencyCallable = Callable[
|
||||||
..., Union[RETURN_TYPE, Coroutine[None, None, RETURN_TYPE]]
|
...,
|
||||||
|
Union[
|
||||||
|
RETURN_TYPE,
|
||||||
|
Coroutine[None, None, RETURN_TYPE],
|
||||||
|
AsyncGenerator[RETURN_TYPE, None],
|
||||||
|
Generator[RETURN_TYPE, None, None],
|
||||||
|
],
|
||||||
]
|
]
|
||||||
|
Reference in New Issue
Block a user