bpo-39487: Merge duplicated _Py_IDENTIFIER identifiers in C code (GH-18254)

Moving repetitive `_Py_IDENTIFIER` instances to a global location helps identify them more easily in regards to sub-interpreter support.
This commit is contained in:
Hai Shi 2020-01-30 17:20:25 -06:00 committed by GitHub
parent c232c9110c
commit 46874c26ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 24 additions and 34 deletions

View file

@ -18,6 +18,8 @@ typedef struct {
PyObject *length;
} rangeobject;
_Py_IDENTIFIER(iter);
/* Helper function for validating step. Always returns a new reference or
NULL on error.
*/
@ -757,7 +759,6 @@ PyDoc_STRVAR(length_hint_doc,
static PyObject *
rangeiter_reduce(rangeiterobject *r, PyObject *Py_UNUSED(ignored))
{
_Py_IDENTIFIER(iter);
PyObject *start=NULL, *stop=NULL, *step=NULL;
PyObject *range;
@ -915,7 +916,6 @@ longrangeiter_len(longrangeiterobject *r, PyObject *no_args)
static PyObject *
longrangeiter_reduce(longrangeiterobject *r, PyObject *Py_UNUSED(ignored))
{
_Py_IDENTIFIER(iter);
PyObject *product, *stop=NULL;
PyObject *range;