-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
priority: highThis issue is more important than mostThis issue is more important than most
Description
For example AbstractEventLoop.create_connection
currently has such signature
@abstractmethod
def create_connection(self, protocol_factory: Any, host: str = ..., port: int = ..., *,
ssl: Any = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: Any = ...,
local_addr: str = ..., server_hostname: str = ...) -> tuple: ...
while in docs this is definitely a coroutine. Actually, the same applies to all coroutines in AbstractEventLoop
.
It is impossible to use any loop's coro methods without putting # type: ignore
on every call.
async def f(l: asyncio.AbstractEventLoop) -> None:
await l.create_connection(...)
return None
mypy reports error: Incompatible types in await (actual type Tuple[Any, ...], expected type "Awaitable")
.
Metadata
Metadata
Assignees
Labels
priority: highThis issue is more important than mostThis issue is more important than most