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 MSeifert, Will Roberts, mark.dickinson, rhettinger, serhiy.storchaka
Date 2017-06-03.16:57:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1496509043.28.0.370832721041.issue30537@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-06-03 16:57:23serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, mark.dickinson, MSeifert, Will Roberts
2017-06-03 16:57:23serhiy.storchakasetmessageid: <1496509043.28.0.370832721041.issue30537@psf.upfronthosting.co.za>
2017-06-03 16:57:23serhiy.storchakalinkissue30537 messages
2017-06-03 16:57:23serhiy.storchakacreate