SimplePrograms challenge

Steve Howell showell30 at
Fri Jun 15 03:17:10 CEST 2007

--- Steven Bethard <steven.bethard at> wrote:

> > How about including a driver?
> Yes, absolutely a good idea. Fortunately, the other
> Steve borrowed the 
> time machine already and added this to the end::
>      for p in iter_primes():
>          if p > 1000: break
>          print p

I think rzed (sorry for bad quoting) was
(partly)making the point that we could have more
explicitly showed how .next() worked.  I'm fine with
the current example, because I think the examples
should solve problems at face value, and here it's
very natural to use a loop with an iterator/generator
(never mind the underlying magic), but I do think some
future example should show how one can have more
control over getting values from an iterator.

Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.

More information about the Python-list mailing list