Anders Lorentsen <pha...@gmail.com> added the comment:

Writing my tests, I originally looked at Lib/test/seq_tests.py. One test case 
uses indexes that are (+-)4*sys.maxsize. This does not fit in Py_ssize_t, and 
so these tests cause my array implementation to raise an overflow exception.

A solution is of course to have the function take general objects instead, and 
then truncate them down to a number that can fit in Py_ssize_t if it's too 
negative or positive).

But I concur. It seems more reasonable to stay consistent with the rest of the 
module, too.

I'll look over the test code to make sure I test for every given scenario (or 
as many as I can think of), and prepare a PR for this, then :)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31956>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to