[Stackless] You cannot __reduce__ the tasklet ...
Christian Tismer
tismer at stackless.com
Wed Jun 2 16:17:10 CEST 2004
Dear Arman,
> I have the following simple example whereby function f() is attempting
> to save a pickle of the current tasklet. As you can see from the run
> output, the tasklet being pickled is neither "current" nor "main". So,
> either the exception message is incorrect or there's a bug.
No, your example has a bug. :-)
...
> def capture():
> last = getcurrent()
> ct = tasklet(get_ct)(last)
> ct.run()
This function keeps an explicit reference to a tasklet which is
involved in the later pickling. This one works:
def capture():
last = getcurrent()
tasklet(get_ct)(last).run()
Aside from that, I'm really not so happy with the solution to
"forbid pickling of current", but I haven't found a reasonable
alternative, yet. maybe allowing the pickle, but making it
non-executable?
kind regards -- 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
http://www.stackless.com/mailman/listinfo/stackless
More information about the Stackless
mailing list