[Stackless-checkins] CVS: slpdev/src/2.3/dev/Python pythonrun.c, 1.17, 1.18
Christian Tismer
tismer at centera.de
Fri Apr 23 02:34:40 CEST 2004
Update of /home/cvs/slpdev/src/2.3/dev/Python
In directory centera.de:/tmp/cvs-serv4949/dev/Python
Modified Files:
pythonrun.c
Log Message:
I did a complete rewrite of Stackless pickling.
There is *no longer* any patched type.
All post-pickled builtin types are now installed into copy_reg.
This is done through a module _wrap in stackless.
The implementation use sshadow type objects which act like the real
types, but they have __reduce__, __new__, __setstate__.
This works just great now.
One missing spot is pickleing of
def f():yield 42
pickle.dumps(type(f()).next)
This needs a slot wrapper which is missing.
Besides that, I have thought out a second rewrite of pickling which uses
a simple special object, which is much smaller and can serve the
same service. This will generalize pickling even much more and will
make it easier to adopt to all those many new types in Zope, for instance.
Stay tuned!
Index: pythonrun.c
===================================================================
RCS file: /home/cvs/slpdev/src/2.3/dev/Python/pythonrun.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** pythonrun.c 19 Apr 2004 19:46:21 -0000 1.17
--- pythonrun.c 23 Apr 2004 00:34:38 -0000 1.18
***************
*** 212,218 ****
_PyImport_Init();
- #ifdef STACKLESS
- _PyStackless_Init();
- #endif
/* initialize builtin exceptions */
--- 212,215 ----
***************
*** 227,230 ****
--- 224,230 ----
initsigs(); /* Signal handling stuff, including initintr() */
+ #ifdef STACKLESS
+ _PyStackless_Init();
+ #endif
initmain(); /* Module __main__ */
if (!Py_NoSiteFlag)
_______________________________________________
Stackless-checkins mailing list
Stackless-checkins at stackless.com
http://www.stackless.com/mailman/listinfo/stackless-checkins
More information about the Stackless-checkins
mailing list