[Python-Dev] Re: PEP 279

Raymond Hettinger python@rcn.com
Tue, 2 Apr 2002 09:07:28 -0500


> Forget the others you mentioned, but insert one at the top, so we get:
>> 0. itemize
> 1. enumerate

Itemize() is too close to the unrelated concept of items:
>>> d = { 'red':'roja', 'blue':'azul' }
>>> d.items()
[('blue', 'azul'), ('red', 'roja')]
>>> list(itemize(d))
[(0,'blue'), (1,'red')]
Let's stick with enumerate().
Raymond

AltStyle によって変換されたページ (->オリジナル) /