Skip to content

Commit d3b5ad9

Browse files
committed
Make TypeIs
Signed-off-by: Michael Carlstrom <rmc@carlstrom.com>
1 parent fb2af66 commit d3b5ad9

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

stdlib/asyncio/coroutines.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ if sys.version_info >= (3, 11):
2525
def iscoroutinefunction(func: Callable[..., Coroutine[Any, Any, Any]]) -> bool: ...
2626
@overload
2727
@deprecated("Deprecated since Python 3.14. Use `inspect.iscoroutinefunction()` instead.")
28-
def iscoroutinefunction(func: Callable[_P, Awaitable[_T]]) -> TypeGuard[Callable[_P, Coroutine[Any, Any, _T]]]: ...
28+
def iscoroutinefunction(func: Callable[_P, Awaitable[_T]]) -> TypeIs[Callable[_P, Coroutine[Any, Any, _T]]]: ...
2929
@overload
3030
@deprecated("Deprecated since Python 3.14. Use `inspect.iscoroutinefunction()` instead.")
31-
def iscoroutinefunction(func: Callable[_P, object]) -> TypeGuard[Callable[_P, Coroutine[Any, Any, Any]]]: ...
31+
def iscoroutinefunction(func: Callable[_P, object]) -> TypeIs[Callable[_P, Coroutine[Any, Any, Any]]]: ...
3232
@overload
3333
@deprecated("Deprecated since Python 3.14. Use `inspect.iscoroutinefunction()` instead.")
34-
def iscoroutinefunction(func: object) -> TypeGuard[Callable[..., Coroutine[Any, Any, Any]]]: ...
34+
def iscoroutinefunction(func: object) -> TypeIs[Callable[..., Coroutine[Any, Any, Any]]]: ...
3535
else:
3636
# Sometimes needed in Python < 3.11 due to the fact that it supports @coroutine
3737
# which was removed in 3.11 which the inspect version doesn't support.
3838
@overload
3939
def iscoroutinefunction(func: Callable[..., Coroutine[Any, Any, Any]]) -> bool: ...
4040
@overload
41-
def iscoroutinefunction(func: Callable[_P, Awaitable[_T]]) -> TypeGuard[Callable[_P, Coroutine[Any, Any, _T]]]: ...
41+
def iscoroutinefunction(func: Callable[_P, Awaitable[_T]]) -> TypeIs[Callable[_P, Coroutine[Any, Any, _T]]]: ...
4242
@overload
43-
def iscoroutinefunction(func: Callable[_P, object]) -> TypeGuard[Callable[_P, Coroutine[Any, Any, Any]]]: ...
43+
def iscoroutinefunction(func: Callable[_P, object]) -> TypeIs[Callable[_P, Coroutine[Any, Any, Any]]]: ...
4444
@overload
45-
def iscoroutinefunction(func: object) -> TypeGuard[Callable[..., Coroutine[Any, Any, Any]]]: ...
45+
def iscoroutinefunction(func: object) -> TypeIs[Callable[..., Coroutine[Any, Any, Any]]]: ...

stdlib/inspect.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,11 @@ def isgeneratorfunction(obj: object) -> TypeGuard[Callable[..., GeneratorType[An
239239
@overload
240240
def iscoroutinefunction(obj: Callable[..., Coroutine[Any, Any, Any]]) -> bool: ...
241241
@overload
242-
def iscoroutinefunction(obj: Callable[_P, Awaitable[_T]]) -> TypeGuard[Callable[_P, CoroutineType[Any, Any, _T]]]: ...
242+
def iscoroutinefunction(obj: Callable[_P, Awaitable[_T]]) -> TypeIs[Callable[_P, CoroutineType[Any, Any, _T]]]: ...
243243
@overload
244-
def iscoroutinefunction(obj: Callable[_P, object]) -> TypeGuard[Callable[_P, CoroutineType[Any, Any, Any]]]: ...
244+
def iscoroutinefunction(obj: Callable[_P, object]) -> TypeIs[Callable[_P, CoroutineType[Any, Any, Any]]]: ...
245245
@overload
246-
def iscoroutinefunction(obj: object) -> TypeGuard[Callable[..., CoroutineType[Any, Any, Any]]]: ...
246+
def iscoroutinefunction(obj: object) -> TypeIs[Callable[..., CoroutineType[Any, Any, Any]]]: ...
247247

248248
def isgenerator(object: object) -> TypeIs[GeneratorType[Any, Any, Any]]: ...
249249
def iscoroutine(object: object) -> TypeIs[CoroutineType[Any, Any, Any]]: ...

0 commit comments

Comments
 (0)