From a4c268c4e4b2e197670dc204cf02404db47fcfcf Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Sat, 5 Dec 2015 14:22:45 -0800 Subject: [PATCH] The typing stub should not import asyncio. Fixes https://github.com/JukkaL/mypy/issues/1050 . --- stdlib/3/typing.pyi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stdlib/3/typing.pyi b/stdlib/3/typing.pyi index e638866f4..eca395c54 100644 --- a/stdlib/3/typing.pyi +++ b/stdlib/3/typing.pyi @@ -1,7 +1,6 @@ # Stubs for typing from abc import abstractmethod, ABCMeta -from asyncio.futures import Future # Definitions of special type checking related constructs. Their definition # 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]): @abstractmethod def close(self) -> None:... +class AbstractFuture(Generic[_T]): ... + class Awaitable(Generic[_T_co]): @abstractmethod - def __await__(self) -> Generator[Future, Any, _T_co]:... + def __await__(self) -> Generator[AbstractFuture[_T_co], Any, _T_co]:... class AsyncIterable(Generic[_T_co]): @abstractmethod