-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 05/22/2014 12:03 PM, Victor Stinner wrote: > Hi, > > 2014-05-22 10:53 GMT+02:00 Saúl Ibarra Corretgé > <[email protected]>: >> I just tried running the aiodns test suite on Python 3.3.X and it >> runs just fine :-) > > Did you modify the code to use Trollius? How? >
I modified it locally, since trollius 0.3 doesn't seem to be on PyPI yet. I did the try-except import dance at the top of aiodns/__init__.py and tests.py. >> I wonder what approach should libraries follow for Python 3.3+, >> since a user could have both asyncio and trollius installed, and >> depending on how the import try-except dance is done results >> could be unexpected... > > In Trollius documentation, I suggested: --- try: # Use Trollius on > Python <= 3.2 import trollius as asyncio except ImportError: # Use > Tulip on Python 3.3, or builtin asyncio on Python 3.4+ import > asyncio --- > > But after reading your mail, I realized that it is not what I > want. Tulip and asyncio of Python 3.4+ should be preferred over > Trollius: --- try: # Use Tulip on Python 3.3, or builtin asyncio on > Python 3.4+ import asyncio except ImportError: # Use Trollius on > Python <= 3.2 import trollius as asyncio --- > Yeah, that was what I had in mind :-) 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+. I could inspect sys.modules and see if there is any sign of trollius there, and then reverse the import order perhaps. - -- Saúl Ibarra Corretgé bettercallsaghul.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iQIcBAEBAgAGBQJTfdBzAAoJEEEOVVOum8BZsR0QAIcfLYfRvxeB9Z27ahHFw40/ IMOQ67e08f3qi3EgCIrP4qKrApNITHrfW/CADKbHyK9s1yEu4170IH8EAk7AyjCw sUZHE55XT7CLcmw2jUxNS9xH67KSxwx8n5ny0ufUTR6w6bPVUifBHHJ4MJe+GMbW Fsi6qGEp7okUxJKfcKqeFLAQiTcr61EmNiLWgHUeHvGxHMu4Mpwt2Dwqa13aS3WK XFYbFMOoPSldfedZVFObIURED0fQLmvcYG2/purQOBe7FX+3EvMlUcXgaaNC3mXl Ru+pzYhit6fjqLbzpMbtL8TOZ1XgmxaXwe9zkG3p3Nf7xDIV/6umOv8O/livV2i0 T9T5tpMPbBnDW/mByGYwH5faGamVjmSvOnFYgQnIDhXRWUrrd4AAyVZa4WNFmbQq zakeKUYaFAK6h55WtE8JzJPnvqHcjj5TG2gpCgOSInrbhmGwzvtDSAfCRf4ogs9K zOyjLUeUcCCp+kTG4HAY7HSnTeexY+6fQBQn3/Be0NG1nT3A6EOdBlhDF/U/PVtR 9QJOhvOCWQBF4id3W/nTxQT/wYKueYsO16H8s/5xQoFdcVFMCxlo0o+LyELgAgxa +QQrlJMWHbmxGF0cuoMjHZyASLKFD/Gu5RW+c7U47geY2m6XnkipYb7g5mwN4DVk mVbW7ZjQSf/d1N8v1zu0 =rCyL -----END PGP SIGNATURE-----
