PEP 255: Simple Generators

Nick Perkins nperkins7 at home.com
Fri Jun 15 18:50:35 EDT 2001


...yeild

neat!
simple, powerful, and easy to understand!

This reminds me of 'contiuations', a la 'call/cc' in Scheme.
( a little harder to understand )
I understand that call/cc can be used to implement all kinds of control
structures.
Yeild sounds more like "set entry point to current continuation, and return"

Could it be used to turn a partially-evaluated function into a first-class
object?
You could have a function that takes it's arguments, "yeilds" None, and then
waits for it's next invocation to actually 'do the dirty work'.
...wait..can they take args?...

What are the implications of generators resembling continuations, and what
is the liklihood that generators will be used/misused/abused to implement
tricky control structures?







More information about the Python-list mailing list