Skip to content

Commit 20ea332

Browse files
use upper bound instead of Any
1 parent b0aeac2 commit 20ea332

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

stdlib/asyncio/coroutines.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22
from collections.abc import Awaitable, Callable, Coroutine
33
from typing import Any, ParamSpec, TypeGuard, TypeVar, overload
4-
from typing_extensions import TypeIs, deprecated
4+
from typing_extensions import Never, TypeIs, deprecated
55

66
# Keep asyncio.__all__ updated with any changes to __all__ here
77
if sys.version_info >= (3, 11):
@@ -17,7 +17,7 @@ if sys.version_info < (3, 11):
1717
@deprecated("Deprecated since Python 3.8; removed in Python 3.11. Use `async def` instead.")
1818
def coroutine(func: _FunctionT) -> _FunctionT: ...
1919

20-
def iscoroutine(obj: object) -> TypeIs[Coroutine[Any, Any, Any]]: ...
20+
def iscoroutine(obj: object) -> TypeIs[Coroutine[object, Never, object]]: ...
2121

2222
if sys.version_info >= (3, 11):
2323
@overload

stdlib/inspect.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ def iscoroutinefunction(obj: Callable[_P, object]) -> TypeGuard[Callable[_P, Cor
246246
def iscoroutinefunction(obj: object) -> TypeGuard[Callable[..., CoroutineType[Any, Any, Any]]]: ...
247247

248248
def isgenerator(object: object) -> TypeIs[GeneratorType[object, Never, object]]: ...
249-
def iscoroutine(object: object) -> TypeIs[CoroutineType[Any, Any, Any]]: ...
250-
def isawaitable(object: object) -> TypeIs[Awaitable[Any]]: ...
249+
def iscoroutine(object: object) -> TypeIs[CoroutineType[object, Never, object]]: ...
250+
def isawaitable(object: object) -> TypeIs[Awaitable[object]]: ...
251251

252252
@overload
253253
def isasyncgenfunction(obj: Callable[..., AsyncGenerator[Any, Any]]) -> bool: ...

0 commit comments

Comments
 (0)