Mark Dickinson wrote:
On Thu, Apr 24, 2008 at 11:50 AM, Nick Coghlan <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    There's definitely some bugs in this area of the range object code
    though:

     >>> x = range(2**33, 2)
     >>> len(x)

    0
     >>> x[0]
    Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
    IndexError: range object index out of range


Hmm.  I'm not seeing the bug here.  What am I missing?

Eh, brain explosion from typing too late at night. The experiment I actually *meant* to try was:

>>> x = range(0, 2**33, 2)
>>> len(x)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: Python int too large to convert to C ssize_t
>>> x[0]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: Python int too large to convert to C ssize_t


The error message in the latter case is thoroughly confusing (although it is now clearer what is causing it).

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