[Python-Dev] PEP 3152 and yield from Future()

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Apr 24 02:33:26 CEST 2015


andrew.svetlov at gmail.com wrote:
> I can live with `cocall fut()` but the difference between `data = yield 
> from loop.sock_recv(sock, 1024)` and `data = cocall 
> (loop.sock_recv(sock, 1024))()` frustrates me very much.

That's not the way it would be done. In a PEP-3152-ified
version of asyncio, sock_recv would be a cofunction, so
that would be just

    data = cocall loop.sock_recv(sock, 1024)

-- 
Greg


More information about the Python-Dev mailing list