PEP 234: Iterators

Roman Suzi rnd at onego.ru
Thu May 3 15:43:00 EDT 2001


On 3 May 2001, Aahz Maruch wrote:

>In article <87ae4v3nju.fsf at elbereth.ccraig.org>,
>Christopher A. Craig <com-nospam at ccraig.org> wrote:
>>Just van Rossum <just at letterror.com> writes:
>>> Roman Suzi wrote:
>>>>
>>>> What about xitems, xvalues, xkeys (as in xrange?)
>>>
>>> Please read the PEP: iterators largely make these
>>> redundant. Eg. dict.iteritems() doesn't return a list of items (we
>>> already have dict.items() for that) but an _iterator_, allowing you
>>> to iterate over the items _without_ creating a list containing them
>>> all...
>>
>>Much as xrange presently doesn't return a list of items, but an object
>>that returns the next item with each successive call to __getitem__.
>>I think his point was that having methods on the mapping objects named
>>xitems, xvalues, and xkeys instead of iteritems, itervalues, and
>>iterkeys would be inline with names of the present xrange and
>>xreadlines functions.
>
>Well, yes.  The whole point of this exercise is that xrange() will be
>essentially deprecated in 2.2.  There's no more need to create any new

8-[ xrange is about to be excluded from Python? Can't it just be
an alternative name of the iterator, doing same thing?

>x*() functions.

Sincerely yours, Roman Suzi
-- 
_/ Russia _/ Karelia _/ Petrozavodsk _/ rnd at onego.ru _/
_/ Thursday, May 03, 2001 _/ Powered by Linux RedHat 6.2 _/
_/ "A conclusion is simply the place where you got tired of thinking." _/





More information about the Python-list mailing list