Making sense of Stackless

Darrell darrell at dorb.com
Sun Feb 27 19:51:45 EST 2000


Christian wrote:
>
> What do you want to achieve with the update() ?
>
I haven't taken the time to learn how to use this yet.
Your solution:
>     c=continuation.current()
>     if c != None:
is exactly what I wanted. Thanks.

>
> This has the same effect as your construct() call.
> current() is the same as caller(0), btw.
> What happens here?
>
If you mean what happens in construct().
Nothing more than  c=continuation.current()

> Well, it would be a speed improvement if we could save that
> if part. You could try a c.update(), but this doesn't work
> since c is dead already. Maybe I should provide a method
> update_release() that does the same thing, but also
> frees the connection? Note that this would combine
> update() and deleting co.link into one step.
>

It would be nice if I could do this.

def classIterator(seq):
    offset= -1
    return continuation.current(1)
    offset=offset+1
    return seq[offset]

The parm into current indicates I want the continuation to point just past
this point.

--Darrell








More information about the Python-list mailing list