Iterators vs. Generators

John Baxter jwbaxter at spamcop.net
Mon Jun 10 20:36:37 EDT 2002


In article <ae3a6f$9d9$1 at panix1.panix.com>, aahz at pythoncraft.com (Aahz) 
wrote:

> So when would one actually write an iterator instead of a generator?
> I've been trying to think of an example and failing.

One answer is...

One would write an interator if one comes from a language which uses 
iterators.

One would write a generator if one comes from a language which uses 
generators.

And one dithers if one is comfortable with both forms.

  ;-)

--John



More information about the Python-list mailing list