Howto: creating empty modules?

Alex Martelli aleax at
Wed Jan 9 11:20:59 CET 2002

"Ville Vainio" <vvainio at> wrote in message
news:yoxelkzrgnh.fsf at
> How should I go about creating an empty module?
> I mean
> config = make_empty_module()
> config.someattr = "hi"

Any module has a name, even an empty one.  As you don't
seem to want to pass a name to the make_empty_module function,
you presumably want that function to generate some artificial
unique name?  You'll have to clarify that.

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.


More information about the Python-list mailing list