On 12/12/2014 10:10 PM, Raymond Hettinger wrote:
I'm -1 on this proposal.
Generators are part of the language internals and language spec, so Guido can reasonably decide to take this in whatever direction he wants. In contrast, now you're moving on to parts of the language library that merely call functions and return results.
It is not the responsibility of accumulate(), filter(), map(), or any other higher-order functions to impose rules about what those functions are allowed to do [...]
Completely agreed. While the problem (at least in some views, my own included) is really about how next() treats an empty iterable, the biggest reason against changing how next() works is because of all the correctly written code that would be broken (by "correct" I mean code that already guards against next() raising a StopIteration). Conversely, the biggest reason for changing just generators (again, at least in my view ;) is that when writing a generator it's easy to forget that you are actually mucking about with internals and should be guarding against an unexpected flow control exception occuring, as it were, out of the blue. -- ~Ethan~