PEP 234: Iterators
gzeljko at sezampro.yu
Thu May 3 16:12:26 CEST 2001
Stephen Hansen <news at myNOSPAM.org> wrote in message
news:Px6I6.4155$mu1.1084402 at typhoon.we.rr.com...
> "Andrew Dalke" <dalke at acm.org> wrote in message
> news:9cqr4q$79q$1 at nntp9.atl.mindspring.net...
> > Stephen Hansen wrote:
> > I can't think of a better name. Stephen suggests "iterate"
> > and "iterator" but I feel those names are too close in spelling.
> > I've noticed that I end up only reading the first few characters
> > and leaving the rest up to the shape of the word. These two
> > words have similar shapes.
> You're right, they do sound far too alike.. so, use
> for the first case, and 'iterator(function, sentinal)' for the second one.
> In the former, we are traversing an iterator, while in the latter one, we
> are actually making an iterator out of a function.
No, both just returns an object which supports
iterator protocol (implements iterator interface).
Iterators purpose is abstraction of iteration
process from underlaying structure/mechanism,
not lazy evalution. (It just solves this problem
for Python, by accident)
More information about the Python-list