[Stackless] why the TaskletExit?

Richard Tew richard.m.tew at gmail.com
Thu Jan 25 08:05:05 CET 2007


On 1/24/07, Andrew Dalke <dalke at dalkescientific.com> wrote:
> But part of it is because of the example at
>
> http://www.stackless.com/wiki/Channels

import stackless

def f():
    print "Still on main tasklet", ["NO", "YES"][stackless.getmain()
is stackless.getcurrent()]

stackless.schedule(f)()

f2 = stackless.schedule(f)
print f2 is f, type(f2) is type(f), type(f), type(f2)

t = stackless.tasklet(f)
print f is t, type(t) is type(f), type(f), type(t)

The wiki page is badly wrong.  The only argument schedule takes and
its docstring names it as retval, is a value to return instead of the
current tasklet when it has finished scheduling.

Admittedly I didn't run the code above, but I am confident it will
illustrate how schedule does nothing related to turning runnables
into tasklets :-)

Richard.

_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless



More information about the Stackless mailing list