[ZODB-Dev] persisting "immutable" classes

John Belmonte john at neggie.net
Sun Feb 29 02:27:14 EST 2004


Tim Peters wrote:
> It's unclear why you need your own {get,set)state functions.  Automagic
> pickle support for new-style objects with __slots__ was added in Python 2.3,
> as described (in excruciating detail) here:
> 
>     http://www.python.org/peps/pep-0307.html
> 
> The magical __slots__ support requires using the new-in-2.3 "pickle protocol
> 2"; that protocol also allows pickle to do lots of other things in better
> ways for new-style classes.

When I try using slots on a second-class persistent object, the new 
pickle protocol doesn't seem to be getting used.  After reading the PEP, 
it's unclear to me how to specify protocol 2 for a given class.  What 
are my options?

-John


-- 
http:// if  ile.org/



More information about the ZODB-Dev mailing list