Skip to content

Commit 749d3db

Browse files
authored
Make asyncio.isfuture a TypeGuard (#7057)
1 parent 220a8d1 commit 749d3db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/asyncio/base_futures.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sys
22
from typing import Any, Callable, Sequence
3-
from typing_extensions import Literal
3+
from typing_extensions import Literal, TypeGuard
44

55
if sys.version_info >= (3, 7):
66
from contextvars import Context
@@ -11,7 +11,7 @@ _PENDING: Literal["PENDING"] # undocumented
1111
_CANCELLED: Literal["CANCELLED"] # undocumented
1212
_FINISHED: Literal["FINISHED"] # undocumented
1313

14-
def isfuture(obj: object) -> bool: ...
14+
def isfuture(obj: object) -> TypeGuard[futures.Future[Any]]: ...
1515

1616
if sys.version_info >= (3, 7):
1717
def _format_callbacks(cb: Sequence[tuple[Callable[[futures.Future[Any]], None], Context]]) -> str: ... # undocumented

0 commit comments

Comments
 (0)