Using pickle with setattr

dataangel k04jg02 at kzoo.edu
Thu Oct 14 18:42:48 EDT 2004


dataangel wrote:

> For the project I'm working on right now I'm dealing with a lot of 
> class objects that I plan to be changing at run-time through the 
> get/has/setattr functions. I'm wondering whether or not the standard 
> Pickle module will handle this or not -- will an object pickle 
> correctly if it has methods that are not in its original class 
> definition? The wiki tells me it doesn't work correctly if you save an 
> object of a class, then change that class and load the object. That 
> I'm not planning to do -- I'm changing the attributes of the object 
> itself.
>
> If it won't, what are my options? Also, is there a module available 
> for saving the complete state of an object such that it is loadable 
> without the python source for the original class?
>
I'm flabbergasted. Nobody on the python mailing list knows? I've stumped 
the experts? ;)

Or maybe my question is stupid for somer reason? :P

*bump* (Pardon me if this is considered excessively rude here, I'm new)




More information about the Python-list mailing list