Re: Unpickling data with classes from dynamic modules

2013-08-21 Thread dieter
Fredrik Tolf writes: > ... >> Maybe all you need to add is implementation for obj.__reduce__ > > That would certainly work, and I guess I could perhaps use it as a > work-around, but that would mean I'd have to mark every single such > class as such in some way or another. What I'm looking for is

RE: Unpickling data with classes from dynamic modules

2013-08-21 Thread Fredrik Tolf
On Wed, 21 Aug 2013, Prasad, Ramit wrote: Fredrik Tolf wrote: [...] I considered trying to create subclasses of the pickler and unpickler that pickle a reference to a module loader and data for the particular module along with a class that comes from such a module, by overriding Pickler.save_glo

RE: Unpickling data with classes from dynamic modules

2013-08-21 Thread Prasad, Ramit
Fredrik Tolf wrote: > > Dear list, > > I have a system in which I load modules dynamically every now and then > (that is, creating a module with types.ModuleType, compiling the code for > the module and then executing it in the module with exec()), and where I > would wish to be able to have clas

Unpickling data with classes from dynamic modules

2013-08-21 Thread Fredrik Tolf
Dear list, I have a system in which I load modules dynamically every now and then (that is, creating a module with types.ModuleType, compiling the code for the module and then executing it in the module with exec()), and where I would wish to be able to have classes in those modules containing