-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/22/2014 12:38 PM, Victor Stinner wrote:
> 2014-05-22 12:24 GMT+02:00 Saúl Ibarra Corretgé
> <[email protected]>:
>> There is, however, a problem: if someone wants to keep a single
>> codebase for their application, regardless of the Python version,
>> they need to go with Trollius, because of yield from vs yield
>> From(), so if that application depends on aiodns then bad things
>> will happen, as it will prefer asyncio over Trollius on Python
>> 3.3+.
> 
> The try/except using asyncio or trollius should only be used for
> code working on both. It is possible to write code working on both
> modules: 
> http://trollius.readthedocs.org/#write-code-working-on-trollius-and-tulip
>
>  For example, it works if you only use callbacks, not coroutines.
> 
> If your code only works on Trollius, why would you use the
> try/except ImportError? I cannot work on Python 3.4 (with
> asyncio).
> 

Let me try to explain again :-) Assume I have a FooApp thing that
works with both trollius and it's designed to be Python 2 and 3
compatible. This application wants to use aiodns now. aiodns doesn't
have a dependency on Python 3 or asyncio because it returns Future
objects, so it doesn't matter if I import Future from asyncio or
trollius. It does matter to FooApp, however.

If FooApp is running on Python 3.4, it will still use trollius, but
when importing aiodns, it will import asyncio in turn. Not necessarily
a bad thing, but the Future objects returned by aiodns are
asyncio.Future, and I don't think that will work when doing yield From
or run_until_complete in trollius, will it?


Cheers,

- -- 
Saúl Ibarra Corretgé
bettercallsaghul.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iQIcBAEBAgAGBQJTfvCxAAoJEEEOVVOum8BZ5X8P/2T1g0ywRumXP6D7EtwfmE6k
IhEKUKBcbxNiZDqRQ2DhbBGkN3tArGaGyoLs4akHXxVpt+tx+IkGIhAy3Br49NTv
Tld/TWbbfwgNexZsMN/OEkgQ13m1060xzG9OCbAlEmjp5Sqj9cudmE2/SQxyx2LJ
lJlsta2TlvRmr/QeYdJQfECjw+Ss29qJXOLldqTh37CMQ86nMaG85t7C95WUI30f
4Y29P0mGTjBshhr9wecneoJCBG0KnCfcs20Jg0jKt9MNVpTFu6gtgHsSofjY2Iy7
09hfFUQAx8XNXlCqbywNvT6Eq0g9UJJLfqgNGYQtovMutN6bouyR0lo4t/LCze2h
10nIPDMQwXnseQ3ktqlVtK2YrbBh7p9iPUxh+QOrJ44uuktGdQRmQWTlBSAudDIU
XKNTdqrx1RqkmJJNlgzn+VLFmYKCLrwFzYcNj+7NZ+UqQPCuBpiSZfCf3jHzX+hG
DVjycoxJtiUWSrIABR6vrUeFuJFzOY+y7JcKXAMZsokGJTMcKrdGXEWErSZCbHqf
XF6PQvUKXh3hsB+oNwQQ8mGAz2r6deOU+dINQFjDGeCXPmcTJfLBELgnDHNE+q0m
pFb7ohvgY8kXnEO65dTOMkia1HOqAlVVWc/OyUeO3wUBTUCglIEQ+qQnnb+57mgu
ZiKQmmpFg9seshGnv5/p
=ppjI
-----END PGP SIGNATURE-----

Reply via email to