Alexander Belopolsky wrote:
Facundo Batista <facundobatista <at> gmail.com> writes:
Ahá! So, as ints are unbound in Python, I could easily do:

r = range(1,1000000000000000000000)

The problem with supporting this is that len(r) will raise overflow error.
It would be nice to get rid of the limitation on len(), but it will be hard
and may not be possible to do efficiently.

My personal preference is that we stay within the bounds of what was possible with the 2.x range() that returned a list instead of a customised object: start, stop and step are unbounded, but the overall length of the resulting sequence cannot exceed sys.maxsize.

All that needs to be done to make this consistent is to move the length calculation into the range object's constructor (and Alexander has already provided a patch to do this in issue 2690)

Cheers,
Nick.

--
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
            http://www.boredomandlaziness.org
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to