3 from collections.abc import Callable, Coroutine
4 from typing import Any, TypeVar
5 from typing_extensions import TypeGuard
7 _F = TypeVar("_F", bound=Callable[..., Any])
9 def coroutine(func: _F) -> _F: ...
10 def iscoroutinefunction(func: object) -> bool: ...
12 if sys.version_info < (3, 8):
13 def iscoroutine(obj: object) -> TypeGuard[types.GeneratorType[Any, Any, Any] | Coroutine[Any, Any, Any]]: ...
16 def iscoroutine(obj: object) -> TypeGuard[Coroutine[Any, Any, Any]]: ...