Skip to content

Commit 6851edd

Browse files
Update Objects/rangeobject.c
Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent d5fa101 commit 6851edd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Objects/rangeobject.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ compute_range_length(PyObject *start, PyObject *stop, PyObject *step)
259259
assert(PyLong_Check(stop));
260260
assert(PyLong_Check(step));
261261

262-
/* fast path for one argument case of range */
262+
/* fast path for start == 0 and step == 1: length is max(stop, 0) */
263263
if (start == zero && step == one) {
264264
if (_PyLong_IsPositive((const PyLongObject *)stop)) {
265265
return Py_NewRef(stop);

0 commit comments

Comments
 (0)