[MATRIX-SIG] Changing shelve...

David J. C. Beach beach@verinet.com
Sat, 04 Oct 1997 13:52:36 -0600


Jim Fulton wrote:

> I think this last idea can work.  Anybody want to volunteer
> to help me make it work? (I have so little time these days. :-()

Well, I'd like to help, but I don't know very much about the internals of
pickle.  (I've only been learning about Python for the last four months or so,
and only in my spare time -- that is -- I bought Mark Lutz's book last spring
and started programming in Python for the first time then.  Worse, I know
virtually nothing of the C API for Python yet...)

Would a change like this be likely to become a standard for 1.5?  It would seem
a shame to make a design change like this, and then to only offer it in a
module.  From what I've heard and read about pickling objects in Python so far,
it seems like what we really want is:

1)  many pickle routines to be implemented in C (cpickle, I guess, for speed)
2)  pickle will use the __reduce__ method to get necessary information for
pickling a particular class.
3)  pickle should pickle functions, and classes (it should automagically call
marshal if/when necessary)
4)  pickle should give the option of packaging a class along with an instance
(so that the receiver of a pickled object can automatically get the bytecode
for the class along with it)

Options 3 and 4 have security implications, of course, but I think there are
many situations in a trusted environment where it might make sense to move code
from one machine to another along with class data, and other Python objects.
Does this sound reasonable?

Dave

--
David J. C. Beach
Colorado State University
mailto:beach@verinet.com
http://www.verinet.com/~beach




_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________