Customizing module globals

Terry Reedy tjreedy at home.com
Thu Sep 6 15:11:43 EDT 2001


" Kerim Borchaev ( WarKiD ) " <warkid at storm.ru> wrote in message
news:mailman.999788588.22289.python-list at python.org...
> Can I specify what module's to be imported symbol table will be?
>
> Say I have a module named Module that assumes that there's an object
> Object without implicit declaration like this :
>
> Module.py
> ----------------
> Object.doThings()
> ----------------
>
> And I can import/run this module with specific a Object?

You can set module attributes in the obvious manner.

import module
module.Object = <some object>

Terry J. Reedy






More information about the Python-list mailing list