[Pythonmac-SIG] Packages and module aliasing - A problem?

Just van Rossum just@letterror.com
Wed, 8 Aug 2001 14:21:36 +0200


Jack Jansen wrote:

> If we go with the package scheme (whether only for Carbon or also for all of 
> the Mac modules) we will have an aliasing problem in the transition period. If 
> the folder structure is like this
> :Mac:Lib:
>          Carbon:
>                 __init__.py
>                 Res.carbon.slb
>                 ...
> and both :Mac:Lib and :Mac:Lib:Carbon are on sys.path we have some modules 
> referring to Res as "import Res" (old, unconverted modules) and some referring 
> to it as "import Carbon.Res" or "from Res import Carbon" (converted modules).
> 
> Does anyone know whether this is going to create problems? Does anyone know 
> for sure that it is _not_ going to create problems?

I have no idea, but loading the same slb twice seems scary indeed.

How about something this:

<bwcompatfolder>:
    Res.py  -> does "from Carbon.Res import *"
    ...

?

Just