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

Victor Stinner victor.stinner at gmail.com
Thu Apr 23 22:29:26 CEST 2015


Hi,

2015-04-23 17:54 GMT+02:00 Yury Selivanov <yselivanov.ml at gmail.com>:

Greg wants to implement cocall on futures. This way you'll be able to write

cocall fut() # instead of "await fut"

Oh, I missed something in the PEP 3152: a obj__cocall__() method can be an iterator/generator, it can be something different than a cofunction. So a cocall() can use yield and yield from. But to use cocall, it must be a cofunction.

It's not easy to understand the whole puzzle. IMO the PEP 492 better explains how pieces are put together ;-)

Victor



More information about the Python-Dev mailing list