[Python-bugs-list] [ python-Bugs-510388 ] Enhance xrange()

noreply@sourceforge.net noreply@sourceforge.net
Wed, 30 Jan 2002 09:04:54 -0800


Bugs item #510388, was opened at 2002-01-29 14:19
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=510388&group_id=5470

Category: Python Interpreter Core
Group: Feature Request
Status: Open
>Resolution: Rejected
Priority: 5
Submitted By: Raymond Hettinger (rhettinger)
Assigned to: Nobody/Anonymous (nobody)
Summary: Enhance xrange()

Initial Comment:
Make the STOP argument optional so that xrange can 
produce an infinite series.

for i in xrange():
   if test(i): break
   print i, 'Failed test. Continuing search.'

Also, add two methods to xrange, .__iter__ and
.next() so that xrange can be used interchangably with
other generators.

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

Comment By: Nobody/Anonymous (nobody)
Date: 2002-01-30 07:50

Message:
Logged In: NO 

This is Guido (can't log in right now).

I'll reject this request; fancy xrange() features are being 
deprecated.  You can get the same effect with xrange
(sys.maxint).

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

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