Xiang Zhang added the comment:
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.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue27333>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com