pre-PEP: Standard Microthreading Pattern

dustin at v.igoro.us dustin at v.igoro.us
Wed May 2 01:52:44 EDT 2007


On Tue, May 01, 2007 at 10:28:08PM -0700, Michele Simionato wrote:
> >        while i < n:
> >            latest = (latest[1], latest[0] + latest[1])
> >            yield                               # cooperative yield
> There is an infinite loop here!

Whoops.  To much editing, not enough actual running of example code :)

> BTW, in spite of having a great tradition, the Fibonacci example sucks
> as a motivation for microthreading programming. You could show a simple
> state machine instead.

You're absolutely right, and among good company in pointing it out.
Thank you for the suggestion of an alternative!

Dustin



More information about the Python-list mailing list