[Python-Dev] PEP 479: Change StopIteration handling inside generators

Antoine Pitrou solipsis at pitrou.net
Fri Nov 21 17:47:31 CET 2014


On Fri, 21 Nov 2014 05:47:58 -0800
Raymond Hettinger <raymond.hettinger at gmail.com> wrote:
> 
> Another issue is that it breaks the way I and others have taught for years that generators are a kind of iterator (an object implementing the iterator protocol) and that a primary motivation for generators is to provide a simpler and more direct way of creating iterators.  However, Chris explained that, "This proposal causes a separation of generators and iterators, so it's no longer possible to pretend that they're the same thing."  That is a major and worrisome conceptual shift.

I agree with Raymond on this point.

Regards

Antoine.




More information about the Python-Dev mailing list