2014-05-12 16:53 GMT+02:00 Guido van Rossum <[email protected]>:
> I think the package should always be called trollius and the import should
> be recommended to be
>
>     import trollius as asyncio

It means that code written for Tulip and Trollius will need to be
modified to use:

try:
    from asyncio import ...   # Tulip, Python 3.4+
except ImportError:
    from trollius import ...   # Trollius for Python < 3.3

A similar pattern is used for code working on Python 2 and Python 3,
but it's not surprising.

But it opens a new question: would it be possible to mix code using
Trollius (trollius) and Tulip (asyncio) in the same process? I mean
use the same event loop. A Trollius event loop should be used to
support Trollius coroutines (using yield). Would it possible to use
Tulip code (ex: aiohttp) with such loop?

I should play with such setup to see how it can work :-)

A "trollius" module name would avoid confusion between Tulip (yield
from) and Trollius (yield).

Victor

Reply via email to