Message295088
Adding support of more general int-like objects in islice() looks reasonable to me. I'm not sure about permutations(), but if make this change, use PyIndex_Check() instead of PyNumber_Check(), or don't use the special check at all, allowing PyNumber_AsSsize_t() to fail.
The __setstate__() methods shouldn't be changed. We know that the __reduce__() methods return exact ints, not general int-like objects.
When replace PyLong_AsSsize_t with PyNumber_AsSsize_t take into account that PyLong_AsSsize_t is atomic and thread-safe, while PyNumber_AsSsize_t can call Python code and release the GIL. |
|
Date |
User |
Action |
Args |
2017-06-03 16:57:23 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, mark.dickinson, MSeifert, Will Roberts |
2017-06-03 16:57:23 | serhiy.storchaka | set | messageid: <1496509043.28.0.370832721041.issue30537@psf.upfronthosting.co.za> |
2017-06-03 16:57:23 | serhiy.storchaka | link | issue30537 messages |
2017-06-03 16:57:23 | serhiy.storchaka | create | |
|