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 xiang.zhang
Recipients mark.dickinson, serhiy.storchaka, xiang.zhang
Date 2016-06-17.15:17:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1466176671.25.0.442742166869.issue27333@psf.upfronthosting.co.za>
In-reply-to
Content
This looks fine. But maybe code like this looks more clear:

if (step && _PyLong_Sign(step) == 0) {
    PyErr_SetString(PyExc_ValueError,
                    "range() arg 3 must not be zero");
    Py_CLEAR(step);
}

I think assert(PyLong_Check(step)) can be left out since _PyLong_Sign also checks it.
History
Date User Action Args
2016-06-17 15:17:51xiang.zhangsetrecipients: + xiang.zhang, mark.dickinson, serhiy.storchaka
2016-06-17 15:17:51xiang.zhangsetmessageid: <1466176671.25.0.442742166869.issue27333@psf.upfronthosting.co.za>
2016-06-17 15:17:51xiang.zhanglinkissue27333 messages
2016-06-17 15:17:51xiang.zhangcreate