summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-11-07 22:07:29 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-11-07 22:07:29 (GMT)
commitbd303c165bc914fc943026ece55f4ebd225614c9 (patch)
tree030e6e557eff5ec98fef23e359498824f21afe4a /Objects/object.c
parent07e9e380f93e334f8f11d3ff9f42bf7c68b27d3a (diff)
downloadcpython-bd303c165bc914fc943026ece55f4ebd225614c9.zip
cpython-bd303c165bc914fc943026ece55f4ebd225614c9.tar.gz
cpython-bd303c165bc914fc943026ece55f4ebd225614c9.tar.bz2
Issue #19512, #19515: remove shared identifiers, move identifiers where they
are used. Move also _Py_IDENTIFIER() defintions to the top in modified files to remove identifiers duplicated in the same file.
Diffstat (limited to 'Objects/object.c')
-rw-r--r--Objects/object.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 9d96e86..acc34af 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -8,6 +8,12 @@
extern "C" {
#endif
+_Py_IDENTIFIER(Py_Repr);
+_Py_IDENTIFIER(__bytes__);
+_Py_IDENTIFIER(__dir__);
+_Py_IDENTIFIER(__isabstractmethod__);
+_Py_IDENTIFIER(builtins);
+
#ifdef Py_REF_DEBUG
Py_ssize_t _Py_RefTotal;
@@ -560,7 +566,6 @@ PyObject *
PyObject_Bytes(PyObject *v)
{
PyObject *result, *func;
- _Py_IDENTIFIER(__bytes__);
if (v == NULL)
return PyBytes_FromString("<NULL>");
@@ -949,7 +954,6 @@ _PyObject_IsAbstract(PyObject *obj)
{
int res;
PyObject* isabstract;
- _Py_IDENTIFIER(__isabstractmethod__);
if (obj == NULL)
return 0;
@@ -1124,7 +1128,7 @@ _PyObject_GetBuiltin(const char *name)
{
PyObject *mod_name, *mod, *attr;
- mod_name = _PyUnicode_FromId(&_PyId_builtins); /* borrowed */
+ mod_name = _PyUnicode_FromId(&PyId_builtins); /* borrowed */
if (mod_name == NULL)
return NULL;
mod = PyImport_Import(mod_name);
@@ -1440,7 +1444,6 @@ static PyObject *
_dir_object(PyObject *obj)
{
PyObject *result, *sorted;
- _Py_IDENTIFIER(__dir__);
PyObject *dirfunc = _PyObject_LookupSpecial(obj, &PyId___dir__);
assert(obj);
@@ -1973,8 +1976,6 @@ _PyObject_DebugTypeStats(FILE *out)
See dictobject.c and listobject.c for examples of use.
*/
-_Py_IDENTIFIER(Py_Repr);
-
int
Py_ReprEnter(PyObject *obj)
{