Skip to content

Commit 2792910

Browse files
Tweak pre-3.8 iscoroutine stub (#8104)
1 parent 55a52a8 commit 2792910

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

stdlib/asyncio/coroutines.pyi

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import sys
2-
import types
32
from collections.abc import Coroutine
43
from typing import Any
54
from typing_extensions import TypeGuard
@@ -20,8 +19,5 @@ if sys.version_info < (3, 11):
2019

2120
def iscoroutinefunction(func: object) -> bool: ...
2221

23-
if sys.version_info >= (3, 8):
24-
def iscoroutine(obj: object) -> TypeGuard[Coroutine[Any, Any, Any]]: ...
25-
26-
else:
27-
def iscoroutine(obj: object) -> TypeGuard[types.GeneratorType[Any, Any, Any] | Coroutine[Any, Any, Any]]: ...
22+
# Can actually be a generator-style coroutine on Python 3.7
23+
def iscoroutine(obj: object) -> TypeGuard[Coroutine[Any, Any, Any]]: ...

0 commit comments

Comments
 (0)