PEP 260: simplify xrange()

D-Man dsh8290 at rit.edu
Tue Jun 26 15:39:09 EDT 2001


On Tue, Jun 26, 2001 at 10:47:28PM +0400, Roman Suzi wrote:
| On Tue, 26 Jun 2001, Guido van Rossum wrote:
| 
| >PEP: 260
| >Title: Simplify xrange()
| >Version: $Revision: 1.1 $
| >Author: guido at python.org (Guido van Rossum)
| >Status: Draft
| >Type: Standards Track
| >Python-Version: 2.2
| >Created: 26-Jun-2001
| >Post-History: 26-Jun-2001
| >
| >Proposed Solution
| >
| >    I propose to strip the xrange() object to the bare minimum.  The
| >    only retained sequence behaviors are x[i], len(x), and repr(x).
| 
| What about str(x)?

It's not needed :

>>> class Example:
...     def __repr__( self ) : return "Hello World"
...
>>> str( Example() )
'Hello World'
>>>

I have no problems with the PEP and I think that the reduced code size
is a good thing.

-D





More information about the Python-list mailing list