On Thu, Apr 24, 2008 at 11:37 AM, Nick Coghlan <[EMAIL PROTECTED]> wrote:

> While I could understand a 'must fit in ssize_t' limitation on the index
> passed to the range object (or conceivably even on the value returned,
> although that would be a little odd), that isn't happening in the example -
> the index being passed in is zero, and the value that should be getting
> returned is zero. Where is that OverflowError coming from? Is there a
> missing PyErr_Clear() call in the range code somewhere? Should the range
> code be invoking a different PyNumber_ call when it does the conversion?
>

Looks like it's coming from range_length, which gets called from
range_item, which implements the sq_item slot.  range_item
uses the length to check the validity of the given index.

I don't think it would be difficult to fix this so that indices
up to the max value of a Py_ssize_t are valid.

I agree it's worth opening a tracker issue for.

Mark
_______________________________________________
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