[Python-Dev] The memo of pickle
Guido van Rossum
Wed, 07 Aug 2002 10:50:45 -0400
> >>Perhaps pickle could grow an option to assume that a
> >>data structure is non-recursive ?! In that case, no
> >>data would be written to the memo (or only the id()
> >>mapped to 1 to double-check).
> > The memo is also for sharing. There's no recursion in this example,
> > but the sharing may be important:
> > a = [1,2,3]
> > b = [a,a,a]
> Right. I don't think these references are too common in pickles.
I think they are.
> Zope Corp should know much more about this, I guess, since ZODB
> is all about pickleing.
Sharing object references is essential in Zope. But only to certain
objects; sharing strings and numbers is not important, and I believe
cPickle doesn't put those in the memo, while pickle.py puts
essentially everything in the memo...
--Guido van Rossum (home page: http://www.python.org/~guido/)