Importing a class without knowing the module

Alex Martelli aleax at mail.comcast.net
Thu Nov 17 20:28:56 EST 2005


Franck PEREZ <franck.perez at gmail.com> wrote:

> I thought about it, but it would make the XML file depend on the
> machine... no more portability...
   ...
> > How about adding Foo.__file__ to the serialized data?

Your top-posting makes this discourse weird (why put your comments
BEFORE the text you're commenting on?!), but anyway I think that using
the class's __module__ rather than __file__ should be what you want.


Alex



More information about the Python-list mailing list