"Full" object and class pickling?

Rainer Deyke root at rainerdeyke.com
Fri Jan 12 18:59:44 EST 2001


"Stuart Stanley" <stuarts at 171.69.180.197> wrote in message
news:979329680.407225 at sj-nntpcache-3...
>
> I am doing some experimenting with mobile objects.  I.E., python
> objects that physically migrate from process to process via some
> mechanism.  I had thought (c)pickle was my ticket, but pickle does
> not bring the _code_ with.  Does anyone know a mechanism to:
>
>   1) "pickle" the _complete_ object, including its byte-code?

'marshal' can serialize code objects, but can't do everything 'pickle' can.
'copy_reg' allows you to add the ability to serialize new types of objects
to 'pickle'.  However, I don't think 'copy_reg' allows you to override the
existing mechanism for pickling classes.  You may have to write your own
subclasses of 'pickle.Pickler' and 'pickle.Unpickler'.


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list