Is Stackless Python DEAD?

Paul Rubin phr-n2001d at nightsong.com
Mon Oct 29 12:53:00 EST 2001


Donn Cave <donn at u.washington.edu> writes:
>    #  callback from UI - selected login option
>    def login(self):
>        name = self.config.loginid
>        password = self.getpassword(name)  # posts password prompt window
>        #  Function actually returns from callback ...
>        #  ... New callback arrives with password requested here;  continue!
>        self.loginwithpassword(name, password)
> 
> That's arguably more readable than any alternative I ever thought of,
> but then it substantially obscures the "real" flow of control in the
> program.  

Nice!  But really, using callbacks in the first place for things like
this is a kludge designed to get around the lack of
coroutines/continuations/threads whatever.  In threaded style you'd
just write getpassword as an ordinary method call that blocks til
the password is entered, then returns.

> Anyway, whether I want to go that way or not (and I don't know for
> myself), it clearly is indeed a meaningful advance, something that
> makes a substantial difference in what you can do with Python.
> Definitely worth looking at, if you have gnarly asynchronous
> programming issues.

I've been toying with the idea of combining a Python parser with a
Scheme implementation, getting continuations and a more serious
compiler/interpreter at the same time.  If done in the obvious way
some Python semantics would break, however.



More information about the Python-list mailing list