[Python-Dev] pickle me, Elmo?

Kevin Jacobs jacobs@penguin.theopalgroup.com
Mon, 10 Feb 2003 13:18:43 -0500 (EST)


On Mon, 10 Feb 2003, Guido van Rossum wrote:
> Alas, that ground is specifically not covered by pickling -- not in
> the past and not now.  This is by design.  Pickling was designed for
> data, and when the data contains a reference to a class or function,
> that reference is specifically excluded from the pickling; instead,
> the pickler says "here's a reference to class C (or function f) in
> module M"; the unpickler imports module M, finds C or f in it, and
> inserts that in the unpicked data.
> 
> But you're not the only one to want to save and restore classes and
> functions.

Or if one wants to pickle instances of classes generated on the fly using
the 'type' constructor and/or metaclasses.  I'm looking forward to
evaluating the pickle protocol 2 to see if it can make this possible.

-Kevin

-- 
--
Kevin Jacobs
The OPAL Group - Enterprise Systems Architect
Voice: (216) 986-0710 x 19         E-mail: jacobs@theopalgroup.com
Fax:   (216) 986-0714              WWW:    http://www.theopalgroup.com