PEP 234: Iterators

Stephen Hansen news at myNOSPAM.org
Thu May 3 00:40:54 EDT 2001


    Okay: I really like the iterators PEP, but to me, I *really* don't like
any of the names which were chosen for it. Abbreviations are fine and dandy,
but the massive use of 'iter' just doesn't read well. I'm likely in the vast
minority, but i'd rather have verbose names then little ones.

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

    And this dict.iterkeys, itervalues, iteritems is REALLY ugly, especially
the iteritems bit. dict.iter_items() is even better.. not much, but better.

It must just be me :)

--Stephen
(replace 'NOSPAM' with 'seraph' to respond in email)





More information about the Python-list mailing list