Import if condition is correct

MindClass jonas.esp at
Sat Oct 28 13:36:11 CEST 2006

Steve Holden wrote:
> I'm guessing that you think this might be necessary to avoid importing
> the same module multiple times: it's not. Python only runs the module's
> code the first time the module is imported into a program. A further
> import statement effectively does noting, because the interpreter sees
> (from an entry in the sys.modules dictionary) that the module is already
> present.
The problem is that I've to import different libraries according to the
ORM (SQLObject, SQLAlchemy, etc)

More information about the Python-list mailing list