I think the package should always be called trollius and the import should
be recommended to be
import trollius as asyncio
and e.g. for queues
from trollius import queues
I don't think there's a convenient aliasing mechanism for modules; for most
stuff you could get away with creating a module whose __init__.py just
imports * from the other package, but I think that won't work right with
items that are not normally included in the import * (only the names
explicitly mentioned in __all__ are exported, and that excludes the
submodule names).
On Mon, May 12, 2014 at 12:17 AM, Victor Stinner
<[email protected]>wrote:
> Hi,
>
> i just received this request on Trollius bug tracker:
>
> "Under Python 3.4, asyncio conflicts with the standard library and it
> makes it difficult to import the trollius version correctly. Since I
> want to use trollius as a backward compatible package with the From()
> syntax, I think it would be easier if I was able to use import
> trollius instead."
>
> https://bitbucket.org/enovance/trollius/issue/8/provide-importable-trollius-name-as-an
>
> What do you think?
>
> It makes sense to use Trollius on Python 3.3 and 3.4 to use the same
> code base on Python 2.6-3.4, but he code should maybe use "import
> trollius" for this use case? We may have an "trollius" module alias on
> Python < 3.3 and only provide a "trollius" module on Python >= 3.3?
>
> I chose the reuse the asyncio name to be able to write code working on
> Trollius (py 2.6-3.2), Tulip (3.3) and CPython (3.4) with the same
> code base.
> http://trollius.readthedocs.org/#write-code-working-on-trollius-and-tulip
>
> For my tests of Trolius on Python 3.4, I modify the PYTHONPATH
> environment variable or sys.path. It's not convinient to use that and
> it can be a real issue if you have two applications, one using
> Trolius, the other using Tulip.
>
> I don't know how to build an "alias" as "trollius".
>
> Victor
>
--
--Guido van Rossum (python.org/~guido)