PEP 234: Iterators
Michael Hudson
mwh21 at cam.ac.uk
Wed May 2 11:10:37 EDT 2001
Roman Suzi <rnd at onego.ru> writes:
> >> xitems, xvalues, and xkeys instead of iteritems, itervalues, and
> >> iterkeys would be inline with names of the present xrange and
> >> xreadlines functions.
> >
> >But .iteritems(), etc. are much better names. So there.
>
> Are them? x* names are more visible in the code code.
But from .iteritems() you have some idea what you're getting; what
does .xitems() suggest to you (if you don't know about xrange)?
> I ca argue that iteitems must be spelled as "iter_items", to be like
> has_key, otherwise, there could be some mis-styling in them?
But arguably has_key is the odd one out here (getattr, hasattr,
__getitem__, etc). But that's very much a minor point.
Cheers,
M.
--
3. Syntactic sugar causes cancer of the semicolon.
-- Alan Perlis, http://www.cs.yale.edu/homes/perlis-alan/quotes.html
More information about the Python-list
mailing list