On Fri, Nov 7, 2014 at 5:13 AM, Steven D'Aprano
What about it? There are 19 lines in the Zen, and I don't think any of them are particularly relevent here. Which line, or lines, were you thinking of?
You asked what was the point in fixing the current behavior regarding StopIteration: - - Beautiful is better than ugly. - Explicit is better than implicit. - Simple is better than complex. - Flat is better than nested. - Readability counts. - Special cases aren't special enough to break the rules. - Errors should never pass silently. - In the face of ambiguity, refuse the temptation to guess. - There should be one-- and preferably only one --obvious way to do it. - Now is better than never. - If the implementation is hard to explain, it's a bad idea. Basically, that some of the behaviours Guido mentioned are unexpected consequences of a lack of foresight in the implementation of generator expressions. It is not in the Zen of Python to leave it as is just because some existing code may be relying on the odd behavior. Just to be clear, that StopIteration will cancel more than one iterator is an unintended behavior that is something difficult to explain, is of questionable usefulness, and is the source of difficult to catch bugs. Cheers, -- Juancarlo *Añez*