On Fri, Jun 17, 2011 at 3:20 PM, Erik Max Francis <m...@alcyone.com> wrote: > Yes, which could be rephrased as the fact that `break` and `continue` are > restricted to looping control structures, so reusing `break` in this context > would be a bad idea.
Which is why I believe 'return' would be a better choice, even though returning a value other than None would make no sense. It would simply be a restriction, and one that almost nobody would notice - like this: >>> def f(): yield 1 yield 2 yield 3 >>> a=f() >>> a <generator object f at 0x00FB4AA8> >>> a.send(1) Traceback (most recent call last): File "<pyshell#7>", line 1, in <module> a.send(1) TypeError: can't send non-None value to a just-started generator ChrisA -- http://mail.python.org/mailman/listinfo/python-list