[issue29344] sock_recv not detected a coroutine
Yury Selivanov added the comment:
Maybe we should switch all these to "awaitable"?
I like this! Would it be OK to add a new sphinx declaration? So that: .. coroutinemethod:: AbstractEventLoop.shutdown_asyncgens() would become: .. awaitable:: AbstractEventLoop.shutdown_asyncgens() ?
Also note that in proactor_events.py, sock_connect() is *not* a coroutine.
Yeah, those small incompatibilities are inevitable for asyncio programs/frameworks -- something that returns a Future may occasionally become a coroutine. Your idea to document API methods as "awaitables" seems to be the right way to go.
In fact I'm not sure what it is -- it calls self._proactor.connect() which appears to return None from the code in windows_events.py. That's presumably a separate bug.
It looks like it returns the result of "IocpProactor.connect()" call, which returns an _OverlappedFuture instance (I don't really know Windows part of asyncio code, so I might be missing something). ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue29344> _______________________________________
Guido van Rossum added the comment: A new Sphinx declaration sounds great to me, but you might want to check with some Sphinx or Python-docs expert. I somehow misread the code of IocpProactor.connect(), so ignore that part -- the point is that it's not always a coroutine. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue29344> _______________________________________
participants (2)
-
Guido van Rossum
-
Yury Selivanov