I wanted to share code from one web2py application to another.

So I created two packages with the same name in two different web2py
applications. I load the code of the package modules with local_import
from the controllers of both application. The two applications are
having almost the same packages in their "modules" directories. The
names of the modules are the same but the code is a little bit
different. Here, I am trying to have name collisions on purpose.

I was expecting collisions because the packages in the 'modules'
directories of my applications are using standard python imports. But
no, I have no collision based on my tests even if my packages are
referencing other packages also located in the "modules" directory.

Is it really safe to do what I do? It is a bit magical.

Reply via email to