Re: Unpickling data with classes from dynamic modules

2013-08-21 Thread dieter
- and it provides for an application level module loader. Zope is using this feature to implement so called "ZClasses", classes the code of which are maintained inside the ZODB. Thus, this is a case similar to yours (your dynamic modules correspond to code maintained in the ZODB). This impl

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

dynamic modules

2005-02-04 Thread Grover
What is the best way to add a modules loaded with __import__() to the global namespace? Example: foo = __import__( 'foo', globals(), locals(), ['*'] ) PS: what exactly are the parameters globals and locals used for? -- http://mail.python.org/mailman/listinfo/python-list