Pickling Robustly

Glyph Lefkowitz glyph at twistedmatrix.com
Fri Apr 21 15:06:28 EDT 2000


m.faassen at vet.uu.nl (Martijn Faassen) writes:

> Glyph Lefkowitz <glyph at twistedmatrix.com> wrote:
> 
> The Digicool people must've run into similar problems with their
> Zope Object Database, which is based on Pickle. Perhaps looking at
> the ZODB wouldn't be a bad idea, if you haven't already, therefore:
> 
> http://www.python.org/workshops/2000-01/proceedings/papers/fulton/zodb3.html
> http://www.zope.org/Members/michel/HowTos/ZODB-How-To
> http://www.zope.org/Documentation/Developer/Models/ZODB
> 
> Though I'm not sure if they indeed have solved your problem, as far
> as I understand it.

Thanks for the link!  This is some great reading, and gives me a
number of things to think about.  However, one of the first things I
noticed was:

      The ZODB stores objects in Python pickle format [van
      Rossum99]. All of the rules for pickling objects apply. See the
      documentation for the Python pickle module for more details.

... so I don't think it *quite* solves my problems :)

(It also imposes some other inconvenient restrictions, such as the necessity of subclassing from Persistent and allowing it to override __setattr__ and __getattr__, which I need to have overridden for various other reasons).

Perhaps I should ask this question in a different way.  How does
Pickle tell if an object is pickleable or not?  Is there some
pickle.ispicklable method I could refer to?

-- 
                  __________________________________________
                 |    ______      __   __  _____  _     _   |
                 |   |  ____ |      \_/   |_____] |_____|   |
                 |   |_____| |_____  |    |       |     |   |
                 |   @ t w i s t e d m a t r i x  . c o m   |
                 |   http://www.twistedmatrix.com/~glyph/   |
                 `__________________________________________'




More information about the Python-list mailing list