Howto: creating empty modules?

Philipp Jocham philipp at salomon.at
Wed Jan 9 08:55:30 EST 2002


On Wed, 9 Jan 2002 11:20:59 +0100, Alex Martelli <aleax at aleax.it> wrote:
>"Ville Vainio" <vvainio at karhu.tp.spt.fi> wrote in message
>news:yoxelkzrgnh.fsf at karhu.tp.spt.fi...
>> How should I go about creating an empty module?
>>
>> I mean
>>
>> config = make_empty_module()
>> config.someattr = "hi"
>
[...]
>
>Apart from that issue, function new.module(somename) from
>standard module new does exactly this.  However, it takes
>the module name as its argument, doesn't generate artificial
>names for the empty modules it creates.

Can somebody clarify the differences between the
functions new.module(name) and imp.new_module(name)?

As it seems neither are inserting the new generated
modules in sys.modules. 

Philipp




More information about the Python-list mailing list