This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients belopolsky, methane, ncoghlan, serhiy.storchaka
Date 2017-01-05.22:04:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The code restored by 29159-index-fallback.patch is slightly different from the code before issue27704, but the patch LGTM except that arguments of assertEqual are in reversed order.

> Can you explain what your patch does?  I don't understand why you single out the OverflowError.  When is __index__ expected to raise it?

PyNumber_AsSsize_t(arg, PyExc_OverflowError) raises an OverflowError when the result of __index__ don't fit in Py_ssize_t.

> I wonder if we could check for buffer protocol support before detecting an integer argument?

This would fix an issue with NumPy arrays, but it is much harder to implement.
Date User Action Args
2017-01-05 22:04:54serhiy.storchakasetrecipients: + serhiy.storchaka, ncoghlan, belopolsky, methane
2017-01-05 22:04:54serhiy.storchakasetmessageid: <>
2017-01-05 22:04:54serhiy.storchakalinkissue29159 messages
2017-01-05 22:04:54serhiy.storchakacreate