>>>>> "Duncan" == Duncan Booth <[EMAIL PROTECTED]> writes: [...] Duncan> Now try: Duncan> Duncan> for command in getCommandsFromUser(): Duncan> print "the result of that command was", execute(command) Duncan> Duncan> where getCommandsFromUser is a greedy generator that reads from stdin, Duncan> and see why generators don't work that way.
I don't see a problem unless the generator isn't defined where it's going to be used. In other similar input bound use cases, such as the generator iterating over a query result set in my original post, I see even less of a problem. Maybe I'm simply daft and you need to spell it out for me. :-) Martin -- http://mail.python.org/mailman/listinfo/python-list