[Python-bugs-list] [ python-Bugs-564601 ] patch 551410 broke xrange

noreply@sourceforge.net noreply@sourceforge.net
Tue, 04 Jun 2002 14:31:03 -0700


Bugs item #564601, was opened at 2002-06-04 17:31
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=564601&group_id=5470

Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: None
Priority: 7
Submitted By: Guido van Rossum (gvanrossum)
Assigned to: Raymond Hettinger (rhettinger)
Summary: patch 551410 broke xrange

Initial Comment:
Patch 551410 is broken.

>>> a = iter(xrange(10))
>>> for i in a:
...     print i    
...     if i == 4: print '*', a.next()
... 
0
1
2
3
4
* 0
5
6
7
8
9
>>>

Compare to:

>>> a = iter(range(10))
>>> for i in a:
...     print i
...     if i == 4: print '*', a.next()
... 
0
1
2
3
4
* 5
6
7
8
9
>>> 


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=564601&group_id=5470