Skip to content
Merged
Prev Previous commit
Next Next commit
Merge branch 'main' into range-iter
  • Loading branch information
serhiy-storchaka committed Mar 28, 2022
commit abf2971d68e32813986973fd1c660201da886e47
4 changes: 2 additions & 2 deletions Objects/rangeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ rangeiter_reduce(rangeiterobject *r, PyObject *Py_UNUSED(ignored))
if (range == NULL)
goto err;
/* return the result */
return Py_BuildValue("N(N)O", _PyEval_GetBuiltinId(&PyId_iter),
return Py_BuildValue("N(N)O", _PyEval_GetBuiltin(&_Py_ID(iter)),
range, Py_None);
Comment on lines +798 to +799
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we care, but we might -- am I right that this writes pickles that can't be read by 3.11 or before?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, absolutely no. I would never propose such change.

Internals will be different, but the unpickled iterator wil produce the same values.

err:
Py_XDECREF(start);
Expand Down Expand Up @@ -965,7 +965,7 @@ longrangeiter_reduce(longrangeiterobject *r, PyObject *Py_UNUSED(ignored))
}

/* return the result */
return Py_BuildValue("N(N)O", _PyEval_GetBuiltinId(&PyId_iter),
return Py_BuildValue("N(N)O", _PyEval_GetBuiltin(&_Py_ID(iter)),
range, Py_None);
}

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.