SimplePrograms challenge
Steve Howell
showell30 at yahoo.com
Thu Jun 14 21:17:10 EDT 2007
--- Steven Bethard <steven.bethard at gmail.com> 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.
http://farechase.yahoo.com/
More information about the Python-list
mailing list