Victor,

On 2/20/2014, 6:33 AM, Victor Stinner wrote:
Hi,

Tulip uses "yield from" whereas this instruction is new in Python 3.3
and cannot be used on Python 2, so Trollius uses "yield" instead. The
problem is that third-party projects like aiohttp uses "yield from".

On the OpenStack mailing list, the following question was asked:
"How useful is trollius if we can't use other thirdparty libraries
written for asyncio?"

Guido once proposed to use 'yield From (fut)' syntax in Trollius.
I think that it was a really great proposition.

Pros:

- Easy to port projects from trollius (python2) to asyncio (python3).
I have a huge experience of writing source code analyzers, and I think
that it will be fairly easy to develop an automatic conversion tool,
that will automatically update 'yield From ()' syntax to 'yield from'.
It should be possible to reuse 2to3 infrastructure (trollius fixer).

Even without using a tool you can simply run 'replace all' command
in your editor.

- Relatively easy to do the reverse port of projects on asyncio to
trollius. Again, automated tool, that goes through the code, and
updates 'yield from' with 'yield From ()' in @coroutines. This one
will be a bit harder to write, but again, entirely possible.

- Once you have your library from asyncio ported to the trollius,
you can still see all places where 'yield from' was. Hence -- easy
debugging.

Cons:

- I don't see any, really. 'From' wrappers will have a small
performance cost, but I'm sure it will be negligible.



Yury

Reply via email to