Customizing module globals

Kerim Borchaev ( WarKiD ) warkid at storm.ru
Mon Sep 10 05:17:20 EDT 2001


>> you can install things in the __builtin__ module at any time:
>>
>>     import __builtin__
>>     __builtin__.Object = something
>>
>> using this to fake "true globals" is a pretty lousy idea, imho.

IVA> Wouldn't it be easier just to use globals()?

IVA>   globals()['Object']=something

As I understand this only modifies current module's globals. Not
globals that will be created for imported module.


Best regards,
 Kerim                            mailto:warkid at storm.ru






More information about the Python-list mailing list