Loading multiple versions of the same package at the same time

Terry Reedy tjreedy at udel.edu
Thu Nov 27 15:34:35 EST 2008


Diez B. Roggisch wrote:
> della wrote:
> 
>> On 27 Nov, 11:21, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
>>
>>> You can't do that. How should python distinguish between the two modules
>>> with the same name?
>> That's why I was trying to import them with different names :)
> 
> You weren't. The "as" creates just a local alias. It's roughly equivalent to
> 
> 
> import foo as bar
> 
> <->
> 
> import foo
> bar = foo
> del foo
> 
> 
> But in the interpreters module dict, foo it is, and stays.

But giving the modules different names on the disk should work, no?




More information about the Python-list mailing list