Skip to content

Commit a4c268c

Browse files
author
Guido van Rossum
committed
The typing stub should not import asyncio. Fixes python/mypy#1050 .
1 parent 107104d commit a4c268c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

stdlib/3/typing.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Stubs for typing
22

33
from abc import abstractmethod, ABCMeta
4-
from asyncio.futures import Future
54

65
# Definitions of special type checking related constructs. Their definition
76
# are not used, so their value does not matter.
@@ -110,9 +109,11 @@ class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]):
110109
@abstractmethod
111110
def close(self) -> None:...
112111

112+
class AbstractFuture(Generic[_T]): ...
113+
113114
class Awaitable(Generic[_T_co]):
114115
@abstractmethod
115-
def __await__(self) -> Generator[Future, Any, _T_co]:...
116+
def __await__(self) -> Generator[AbstractFuture[_T_co], Any, _T_co]:...
116117

117118
class AsyncIterable(Generic[_T_co]):
118119
@abstractmethod

0 commit comments

Comments
 (0)