[Tutor] 2 problems in a small script

Kent Johnson kent37 at tds.net
Fri Oct 12 16:53:36 CEST 2007

Dick Moores wrote:
> Terrific, Kent. I promise I'll use 'em whenever I can. And I'll also 
> try again to understand generators: 
> <http://docs.python.org/tut/node11.html#SECTION00111000000000000000000>. 
> But I'll begin with the section just before that, on iterators: 
> <http://docs.python.org/tut/node11.html#SECTION0011900000000000000000>. 
> Looks like tough going..

Maybe you like my writeup better:

There's not much reason to write iterators from scratch anymore; in most 
cases it is simpler to write a generator function. It's good to 
understand the concept of an iterator but the details of the plumbing 
are not so important.


More information about the Tutor mailing list