[Python-3000] Using range()

Mark Dickinson dickinsm at gmail.com
Sat Apr 26 01:24:09 CEST 2008


On Fri, Apr 25, 2008 at 12:04 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:

>
> 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).
>

Agreed.  See also the discussion over at

http://bugs.python.org/issue2690

Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-3000/attachments/20080425/e10f838c/attachment.htm>


More information about the Python-3000 mailing list