Skip to content

Commit bd928fe

Browse files
committed
Rename _Py_identifier to _Py_IDENTIFIER.
1 parent 01277d1 commit bd928fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+262
-262
lines changed

Include/unicodeobject.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2031,7 +2031,7 @@ PyAPI_FUNC(int) _PyUnicode_CheckConsistency(
20312031
20322032
do
20332033
2034-
_Py_identifier(foo);
2034+
_Py_IDENTIFIER(foo);
20352035
...
20362036
r = _PyObject_CallMethodId(o, &PyId_foo, "args", ...);
20372037
@@ -2050,7 +2050,7 @@ typedef struct _Py_Identifier {
20502050
} _Py_Identifier;
20512051

20522052
#define _Py_static_string(varname, value) static _Py_Identifier varname = { 0, value, 0 }
2053-
#define _Py_identifier(varname) _Py_static_string(PyId_##varname, #varname)
2053+
#define _Py_IDENTIFIER(varname) _Py_static_string(PyId_##varname, #varname)
20542054

20552055
/* Return an interned Unicode object for an Identifier; may fail if there is no memory.*/
20562056
PyAPI_FUNC(PyObject*) _PyUnicode_FromId(_Py_Identifier*);

Modules/_bisectmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ insort_right(PyObject *self, PyObject *args, PyObject *kw)
8686
if (PyList_Insert(list, index, item) < 0)
8787
return NULL;
8888
} else {
89-
_Py_identifier(insert);
89+
_Py_IDENTIFIER(insert);
9090

9191
result = _PyObject_CallMethodId(list, &PyId_insert, "nO", index, item);
9292
if (result == NULL)
@@ -188,7 +188,7 @@ insort_left(PyObject *self, PyObject *args, PyObject *kw)
188188
if (PyList_Insert(list, index, item) < 0)
189189
return NULL;
190190
} else {
191-
_Py_identifier(insert);
191+
_Py_IDENTIFIER(insert);
192192

193193
result = _PyObject_CallMethodId(list, &PyId_insert, "iO", index, item);
194194
if (result == NULL)

Modules/_collectionsmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ static PyObject *
767767
deque_reduce(dequeobject *deque)
768768
{
769769
PyObject *dict, *result, *aslist;
770-
_Py_identifier(__dict__);
770+
_Py_IDENTIFIER(__dict__);
771771

772772
dict = _PyObject_GetAttrId((PyObject *)deque, &PyId___dict__);
773773
if (dict == NULL)
@@ -1335,7 +1335,7 @@ defdict_reduce(defdictobject *dd)
13351335
PyObject *items;
13361336
PyObject *iter;
13371337
PyObject *result;
1338-
_Py_identifier(items);
1338+
_Py_IDENTIFIER(items);
13391339

13401340
if (dd->default_factory == NULL || dd->default_factory == Py_None)
13411341
args = PyTuple_New(0);

Modules/_csv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ csv_writer(PyObject *module, PyObject *args, PyObject *keyword_args)
13171317
{
13181318
PyObject * output_file, * dialect = NULL;
13191319
WriterObj * self = PyObject_GC_New(WriterObj, &Writer_Type);
1320-
_Py_identifier(write);
1320+
_Py_IDENTIFIER(write);
13211321

13221322
if (!self)
13231323
return NULL;

Modules/_ctypes/_ctypes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3679,7 +3679,7 @@ _build_result(PyObject *result, PyObject *callargs,
36793679
PyTuple_SET_ITEM(tup, index, v);
36803680
index++;
36813681
} else if (bit & outmask) {
3682-
_Py_identifier(__ctypes_from_outparam__);
3682+
_Py_IDENTIFIER(__ctypes_from_outparam__);
36833683

36843684
v = PyTuple_GET_ITEM(callargs, i);
36853685
v = _PyObject_CallMethodId(v, &PyId___ctypes_from_outparam__, NULL);

Modules/_ctypes/callproc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,8 +1687,8 @@ unpickle(PyObject *self, PyObject *args)
16871687
PyObject *state;
16881688
PyObject *result;
16891689
PyObject *tmp;
1690-
_Py_identifier(__new__);
1691-
_Py_identifier(__setstate__);
1690+
_Py_IDENTIFIER(__new__);
1691+
_Py_IDENTIFIER(__setstate__);
16921692

16931693
if (!PyArg_ParseTuple(args, "OO", &typ, &state))
16941694
return NULL;

Modules/_cursesmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,7 @@ PyCursesWindow_PutWin(PyCursesWindowObject *self, PyObject *stream)
14181418
while (1) {
14191419
char buf[BUFSIZ];
14201420
Py_ssize_t n = fread(buf, 1, BUFSIZ, fp);
1421-
_Py_identifier(write);
1421+
_Py_IDENTIFIER(write);
14221422

14231423
if (n <= 0)
14241424
break;
@@ -1913,7 +1913,7 @@ PyCurses_GetWin(PyCursesWindowObject *self, PyObject *stream)
19131913
WINDOW *win;
19141914

19151915
PyCursesInitialised;
1916-
_Py_identifier(read);
1916+
_Py_IDENTIFIER(read);
19171917

19181918
strcpy(fn, "/tmp/py.curses.getwin.XXXXXX");
19191919
fd = mkstemp(fn);

Modules/_datetimemodule.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ static PyObject *
946946
call_tzname(PyObject *tzinfo, PyObject *tzinfoarg)
947947
{
948948
PyObject *result;
949-
_Py_identifier(tzname);
949+
_Py_IDENTIFIER(tzname);
950950

951951
assert(tzinfo != NULL);
952952
assert(check_tzinfo_subclass(tzinfo) >= 0);
@@ -1079,7 +1079,7 @@ make_Zreplacement(PyObject *object, PyObject *tzinfoarg)
10791079
PyObject *temp;
10801080
PyObject *tzinfo = get_tzinfo_member(object);
10811081
PyObject *Zreplacement = PyUnicode_FromStringAndSize(NULL, 0);
1082-
_Py_identifier(replace);
1082+
_Py_IDENTIFIER(replace);
10831083

10841084
if (Zreplacement == NULL)
10851085
return NULL;
@@ -1289,7 +1289,7 @@ wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple,
12891289
goto Done;
12901290
format = PyUnicode_FromString(PyBytes_AS_STRING(newfmt));
12911291
if (format != NULL) {
1292-
_Py_identifier(strftime);
1292+
_Py_IDENTIFIER(strftime);
12931293

12941294
result = _PyObject_CallMethodId(time, &PyId_strftime, "OO",
12951295
format, timetuple, NULL);
@@ -1318,7 +1318,7 @@ time_time(void)
13181318
PyObject *time = PyImport_ImportModuleNoBlock("time");
13191319

13201320
if (time != NULL) {
1321-
_Py_identifier(time);
1321+
_Py_IDENTIFIER(time);
13221322

13231323
result = _PyObject_CallMethodId(time, &PyId_time, "()");
13241324
Py_DECREF(time);
@@ -1337,7 +1337,7 @@ build_struct_time(int y, int m, int d, int hh, int mm, int ss, int dstflag)
13371337

13381338
time = PyImport_ImportModuleNoBlock("time");
13391339
if (time != NULL) {
1340-
_Py_identifier(struct_time);
1340+
_Py_IDENTIFIER(struct_time);
13411341

13421342
result = _PyObject_CallMethodId(time, &PyId_struct_time,
13431343
"((iiiiiiiii))",
@@ -1578,7 +1578,7 @@ multiply_float_timedelta(PyObject *floatobj, PyDateTime_Delta *delta)
15781578
PyObject *result = NULL;
15791579
PyObject *pyus_in = NULL, *temp, *pyus_out;
15801580
PyObject *ratio = NULL;
1581-
_Py_identifier(as_integer_ratio);
1581+
_Py_IDENTIFIER(as_integer_ratio);
15821582

15831583
pyus_in = delta_to_microseconds(delta);
15841584
if (pyus_in == NULL)
@@ -1677,7 +1677,7 @@ truedivide_timedelta_float(PyDateTime_Delta *delta, PyObject *f)
16771677
PyObject *result = NULL;
16781678
PyObject *pyus_in = NULL, *temp, *pyus_out;
16791679
PyObject *ratio = NULL;
1680-
_Py_identifier(as_integer_ratio);
1680+
_Py_IDENTIFIER(as_integer_ratio);
16811681

16821682
pyus_in = delta_to_microseconds(delta);
16831683
if (pyus_in == NULL)
@@ -2473,7 +2473,7 @@ date_today(PyObject *cls, PyObject *dummy)
24732473
{
24742474
PyObject *time;
24752475
PyObject *result;
2476-
_Py_identifier(fromtimestamp);
2476+
_Py_IDENTIFIER(fromtimestamp);
24772477

24782478
time = time_time();
24792479
if (time == NULL)
@@ -2626,7 +2626,7 @@ date_isoformat(PyDateTime_Date *self)
26262626
static PyObject *
26272627
date_str(PyDateTime_Date *self)
26282628
{
2629-
_Py_identifier(isoformat);
2629+
_Py_IDENTIFIER(isoformat);
26302630

26312631
return _PyObject_CallMethodId((PyObject *)self, &PyId_isoformat, "()");
26322632
}
@@ -2647,7 +2647,7 @@ date_strftime(PyDateTime_Date *self, PyObject *args, PyObject *kw)
26472647
PyObject *result;
26482648
PyObject *tuple;
26492649
PyObject *format;
2650-
_Py_identifier(timetuple);
2650+
_Py_IDENTIFIER(timetuple);
26512651
static char *keywords[] = {"format", NULL};
26522652

26532653
if (! PyArg_ParseTupleAndKeywords(args, kw, "U:strftime", keywords,
@@ -2667,7 +2667,7 @@ static PyObject *
26672667
date_format(PyDateTime_Date *self, PyObject *args)
26682668
{
26692669
PyObject *format;
2670-
_Py_identifier(strftime);
2670+
_Py_IDENTIFIER(strftime);
26712671

26722672
if (!PyArg_ParseTuple(args, "U:__format__", &format))
26732673
return NULL;
@@ -3077,8 +3077,8 @@ tzinfo_reduce(PyObject *self)
30773077
{
30783078
PyObject *args, *state, *tmp;
30793079
PyObject *getinitargs, *getstate;
3080-
_Py_identifier(__getinitargs__);
3081-
_Py_identifier(__getstate__);
3080+
_Py_IDENTIFIER(__getinitargs__);
3081+
_Py_IDENTIFIER(__getstate__);
30823082

30833083
tmp = PyTuple_New(0);
30843084
if (tmp == NULL)
@@ -3592,7 +3592,7 @@ time_repr(PyDateTime_Time *self)
35923592
static PyObject *
35933593
time_str(PyDateTime_Time *self)
35943594
{
3595-
_Py_identifier(isoformat);
3595+
_Py_IDENTIFIER(isoformat);
35963596

35973597
return _PyObject_CallMethodId((PyObject *)self, &PyId_isoformat, "()");
35983598
}
@@ -4173,7 +4173,7 @@ datetime_now(PyObject *cls, PyObject *args, PyObject *kw)
41734173
if (self != NULL && tzinfo != Py_None) {
41744174
/* Convert UTC to tzinfo's zone. */
41754175
PyObject *temp = self;
4176-
_Py_identifier(fromutc);
4176+
_Py_IDENTIFIER(fromutc);
41774177

41784178
self = _PyObject_CallMethodId(tzinfo, &PyId_fromutc, "O", self);
41794179
Py_DECREF(temp);
@@ -4212,7 +4212,7 @@ datetime_fromtimestamp(PyObject *cls, PyObject *args, PyObject *kw)
42124212
if (self != NULL && tzinfo != Py_None) {
42134213
/* Convert UTC to tzinfo's zone. */
42144214
PyObject *temp = self;
4215-
_Py_identifier(fromutc);
4215+
_Py_IDENTIFIER(fromutc);
42164216

42174217
self = _PyObject_CallMethodId(tzinfo, &PyId_fromutc, "O", self);
42184218
Py_DECREF(temp);
@@ -4239,7 +4239,7 @@ datetime_strptime(PyObject *cls, PyObject *args)
42394239
{
42404240
static PyObject *module = NULL;
42414241
PyObject *string, *format;
4242-
_Py_identifier(_strptime_datetime);
4242+
_Py_IDENTIFIER(_strptime_datetime);
42434243

42444244
if (!PyArg_ParseTuple(args, "UU:strptime", &string, &format))
42454245
return NULL;
@@ -4495,7 +4495,7 @@ datetime_repr(PyDateTime_DateTime *self)
44954495
static PyObject *
44964496
datetime_str(PyDateTime_DateTime *self)
44974497
{
4498-
_Py_identifier(isoformat);
4498+
_Py_IDENTIFIER(isoformat);
44994499

45004500
return _PyObject_CallMethodId((PyObject *)self, &PyId_isoformat, "(s)", " ");
45014501
}
@@ -4704,7 +4704,7 @@ datetime_astimezone(PyDateTime_DateTime *self, PyObject *args, PyObject *kw)
47044704
PyObject *offset;
47054705
PyObject *temp;
47064706
PyObject *tzinfo;
4707-
_Py_identifier(fromutc);
4707+
_Py_IDENTIFIER(fromutc);
47084708
static char *keywords[] = {"tz", NULL};
47094709

47104710
if (! PyArg_ParseTupleAndKeywords(args, kw, "O!:astimezone", keywords,

Modules/_elementtree.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ element_find(ElementObject* self, PyObject* args)
797797
return NULL;
798798

799799
if (checkpath(tag) || namespaces != Py_None) {
800-
_Py_identifier(find);
800+
_Py_IDENTIFIER(find);
801801
return _PyObject_CallMethodId(
802802
elementpath_obj, &PyId_find, "OOO", self, tag, namespaces
803803
);
@@ -825,7 +825,7 @@ element_findtext(ElementObject* self, PyObject* args)
825825
PyObject* tag;
826826
PyObject* default_value = Py_None;
827827
PyObject* namespaces = Py_None;
828-
_Py_identifier(findtext);
828+
_Py_IDENTIFIER(findtext);
829829

830830
if (!PyArg_ParseTuple(args, "O|OO:findtext", &tag, &default_value, &namespaces))
831831
return NULL;
@@ -868,7 +868,7 @@ element_findall(ElementObject* self, PyObject* args)
868868
return NULL;
869869

870870
if (checkpath(tag) || namespaces != Py_None) {
871-
_Py_identifier(findall);
871+
_Py_IDENTIFIER(findall);
872872
return _PyObject_CallMethodId(
873873
elementpath_obj, &PyId_findall, "OOO", self, tag, namespaces
874874
);
@@ -900,7 +900,7 @@ element_iterfind(ElementObject* self, PyObject* args)
900900
{
901901
PyObject* tag;
902902
PyObject* namespaces = Py_None;
903-
_Py_identifier(iterfind);
903+
_Py_IDENTIFIER(iterfind);
904904

905905
if (!PyArg_ParseTuple(args, "O|O:iterfind", &tag, &namespaces))
906906
return NULL;

Modules/_io/_iomodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ io_open(PyObject *self, PyObject *args, PyObject *kwds)
225225

226226
PyObject *raw, *modeobj = NULL, *buffer = NULL, *wrapper = NULL;
227227

228-
_Py_identifier(isatty);
229-
_Py_identifier(fileno);
228+
_Py_IDENTIFIER(isatty);
229+
_Py_IDENTIFIER(fileno);
230230

231231
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|sizzzi:open", kwlist,
232232
&file, &mode, &buffering,

0 commit comments

Comments
 (0)