who uses Python or Ruby, and for what?

Thomas Bellman bellman at lysator.liu.se
Tue May 1 20:08:47 EDT 2001


"Fredrik Lundh" <fredrik at pythonware.com> writes:

> Python has always had iterators, implemented as forward-only
> sequences.

The iterator was then the integer you passed to __getitem__()?
Many people would consider that a *very* limited form of
iterator.

>             The new iterator model doesn't add anything that
> you haven't been able to do before; it just makes things a bit
> easier to implement and use.

The ability to have several independent and concurrent iterators
for a single sequence object was not there.  At least not if you
wanted it to be efficient.  And several other things you can do
with proper iterators were more than "a bit" more difficult to
implement.

Sure, you could *implement* iterators in Python, but that's
not the same as there *being* iterators.  By that reasoning,
you could say that C and Pascal has iterators, or that MS-DOS
has multitasking (you could always load a multitasker, like
MS Windows, on top of MS-DOS).


-- 
Thomas Bellman,   Lysator Computer Club,   Linköping University,  Sweden
"I don't think [that word] means what you    !  bellman @ lysator.liu.se
 think it means."   -- The Princess Bride    !  Make Love -- Nicht Wahr!



More information about the Python-list mailing list