Georg Brandl <[EMAIL PROTECTED]> wrote:

> Slight terminology glitch -- it does return an iterator, not a
> generator. Generators are functions that return iterators.

xrange returns an ITERABLE, not an ITERATOR.  Videat:

>>> a = xrange(23, 43)
>>> a.next()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: 'xrange' object has no attribute 'next'
>>> 

No next method -> not an iterator.  iter(xrange(...)) DOES return an
iterator, btw.


Alex
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to