[Stackless] The New Pickling Concept

Christian Tismer tismer at stackless.com
Fri Apr 23 02:41:32 CEST 2004

Stackless pickling has got a complete re-write.
There is not any single type patched any longer.
Instead, all types have got a shadow type which
is living in the stackless._wrap module.

The wrapper types create a subtype of the real type when
invoked. On __setstate__, they set the real data (to avoid
deep recursion), and they set the real type. Afterwards,
just an innocent object of the target type exists, which is
not changed at all.

This is just an intermediate step towards the final solution.
I will now rewrite things, again, in a much more generic style.
Types-to-be-pickled will just have to provide a __reduce__
function and a __new__ function. The framework will make sure
that the __new__ actually takes place in the __setstate__ phase.
With that concept, we will have no problems with recursive objects.

I think this is worth a lightning talk at Europython.

ciao - chris
Christian Tismer             :^)   <mailto:tismer at stackless.com>
Mission Impossible 5oftware  :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9a     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 89 09 53 34  home +49 30 802 86 56  mobile +49 173 24 18 776
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
      whom do you want to sponsor today?   http://www.stackless.com/

Stackless mailing list
Stackless at stackless.com

More information about the Stackless mailing list