PEP 234: Iterators

Thomas Bellman bellman at lysator.liu.se
Thu May 3 08:41:00 EDT 2001


"Stephen Hansen" <news at myNOSPAM.org> wrote:

>     I'd like to read 'iter(object)' as 'iterate(object)' and 'iter(func,
> sequence)' as 'iterator(func, sequence)' since the latter is making an
> iterator on the fly, and not iterating over it...

But the former *doesn't* iterate over the sequence.  It *also*
instantiates (creates) an iterator.  The *for* statement and the
*map()* function iterates; the iter() function (whatever spelling)
doesn't, so it shouldn't be called iterate().

>                                                   but that really doesn't
> matter, i'd much rather just see 'iterate' for both of them. Perhaps it
> would be better to 'traverse(iterator-object)' and then 'iterator(func,
> sequence)'. In fact, that's my favorite option.. getting rid of the
> excessive use of 'iter' and just calling it 'traverse'.

Same problem with the name traverse().


-- 
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