Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit d6d23ea

Browse files
author
Anselm Kruis
committed
Stackless issue #139: documentation update
Update the documentation regarding pickling. More to come.
1 parent 99ac643 commit d6d23ea

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Doc/library/stackless/pickling.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,37 @@ different address than *t1*, which was displayed earlier.
100100
this is true, is where not all the functions called by the code within
101101
the tasklet are |PY| functions. The Stackless pickling mechanism
102102
has no ability to deal with C functions that may have been called.
103+
104+
.. note::
105+
106+
It is not possible to unpickle running tasklets which were pickled by a
107+
different minor version of |SLP|. A running tasklet contains frame
108+
objects and frame objects contain code objects. And code objects are
109+
usually incompatible between different minor versions of |CPY|.
110+
111+
======================
112+
Pickling other objects
113+
======================
114+
115+
In order to be able to pickle tasklets Stackless needs to be able to pickle
116+
several other objects, which can't be pickled by |CPY|. |SLP|
117+
uses :func:`copyreg.pickle` to register “reduction” functions for the following
118+
types:
119+
:data:`~types.FunctionType`,
120+
:data:`~types.CodeType`,
121+
:data:`~types.CoroutineType`,
122+
:data:`~types.GeneratorType`,
123+
:data:`~types.ModuleType`,
124+
:data:`~types.TracebackType`,
125+
:ref:`Cell Objects <cell-objects>` and
126+
all kinds of :ref:`Dictionary view objects <dict-views>`.
127+
128+
Frames
129+
======
130+
131+
|SLP| can pickle frames, but only as part of a
132+
tasklet, a traceback-object, a generator, a coroutine or an asynchronous
133+
generator. Stackless does not register a "reduction" function for
134+
:data:`~types.FrameType`. This way Stackless stays compatible with application
135+
code that registers its own "reduction" function for :data:`~types.FrameType`.
136+

0 commit comments

Comments
 (0)