Message284774
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:54 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, ncoghlan, belopolsky, methane |
2017-01-05 22:04:54 | serhiy.storchaka | set | messageid: <1483653894.58.0.639450208838.issue29159@psf.upfronthosting.co.za> |
2017-01-05 22:04:54 | serhiy.storchaka | link | issue29159 messages |
2017-01-05 22:04:54 | serhiy.storchaka | create | |
|