[Stackless] Link to Stackless.py with select

Richard Tew richard.m.tew at gmail.com
Thu Jun 10 04:35:24 CEST 2010


On Thu, Jun 10, 2010 at 6:37 AM, Andrew Francis <andrewfr_ice at yahoo.com> wrote:
> Here is a link to an initial version of stackless.py with tasklet.select(): http://stacklessexamples.googlecode.com/files/stackless.py. I have an explanation of the usage and changes here: http://andrewfr.wordpress.com/ (not the best place for posting code). I would appreciate comments.

Superficially.. The list passed to 'select' is superfluous, you can
just pass N arguments and use *args to make a list internally.
Obtaining a reference to the current tasklet is not the most natural
operation.  Having 'select' on the stackless module might be better.

Looking at your code, with special 'sendCase' and 'receiveCase'
methods, required use of an if statement or dictionary to dispatch the
result of the operation and so on.  What this says to me is that
'select' is not a natural fit for Python.  The other languages I have
seen it in, have language syntax that accompanies it which makes it a
natural part of the given language.  Special operators and things like
that.

An area for further experimentation might be to take a look at the
"goto" addition to Python and see if you can add a custom syntax that
might bring this to a more natural level in Python.

Cheers,
Richard.



More information about the Stackless mailing list