Using pickle with setattr

D

dataangel

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top