[Python-Help] imp.load_module from a string

Martin von Loewis loewis at informatik.hu-berlin.de
Mon Jul 10 13:20:33 EDT 2000


> Hmmm, some of these classes are being used to unpickle objects sent from
> the server. I guess I just have to make sure the right version of the
> module is in sys.modules when I unpickle the object?

Exactly. pickle sends klasse.__name__ and klasse.__module__; unpickle
expects to find those in sys.module, or imports the module if not
found.

As a result, you can't pickle nested classes, either.

Regards,
Martin




More information about the Python-list mailing list