Using pickle with setattr

Discussion in 'Python' started by dataangel, Oct 13, 2004.

  1. dataangel

    dataangel Guest

    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?
     
    dataangel, Oct 13, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gerson Kurz
    Replies:
    4
    Views:
    395
    Larry Bates
    Jun 14, 2004
  2. dataangel

    Re: Using pickle with setattr

    dataangel, Oct 14, 2004, in forum: Python
    Replies:
    3
    Views:
    324
    dataangel
    Oct 15, 2004
  3. a pickle's pickle

    , Aug 2, 2005, in forum: Python
    Replies:
    4
    Views:
    400
  4. Nathan Harmston

    recursion error using setattr and getattr

    Nathan Harmston, Jun 7, 2007, in forum: Python
    Replies:
    0
    Views:
    295
    Nathan Harmston
    Jun 7, 2007
  5. Michele Simionato
    Replies:
    2
    Views:
    1,927
    Michele Simionato
    May 23, 2008
Loading...

Share This Page