summaryrefslogtreecommitdiffstats
path: root/Objects/enumobject.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-01-22 16:24:29 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-01-22 16:24:29 (GMT)
commitce798520778e9cb41adfdc4f0a3cb5085a0b11be (patch)
tree915ea477cc6dfaa170d851f0c54f72b07c544874 /Objects/enumobject.c
parentcd8991255c963858cc74f32d718e1d54987b26a0 (diff)
downloadcpython-ce798520778e9cb41adfdc4f0a3cb5085a0b11be.zip
cpython-ce798520778e9cb41adfdc4f0a3cb5085a0b11be.tar.gz
cpython-ce798520778e9cb41adfdc4f0a3cb5085a0b11be.tar.bz2
use the static identifier api for looking up special methods
I had to move the static identifier code from unicodeobject.h to object.h in order for this to work.
Diffstat (limited to 'Objects/enumobject.c')
-rw-r--r--Objects/enumobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/enumobject.c b/Objects/enumobject.c
index 00a3346..23b3808 100644
--- a/Objects/enumobject.c
+++ b/Objects/enumobject.c
@@ -224,8 +224,8 @@ reversed_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
Py_ssize_t n;
PyObject *seq, *reversed_meth;
- static PyObject *reversed_cache = NULL;
reversedobject *ro;
+ _Py_IDENTIFIER(__reversed__);
if (type == &PyReversed_Type && !_PyArg_NoKeywords("reversed()", kwds))
return NULL;
@@ -233,7 +233,7 @@ reversed_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (!PyArg_UnpackTuple(args, "reversed", 1, 1, &seq) )
return NULL;
- reversed_meth = _PyObject_LookupSpecial(seq, "__reversed__", &reversed_cache);
+ reversed_meth = _PyObject_LookupSpecial(seq, &PyId___reversed__);
if (reversed_meth != NULL) {
PyObject *res = PyObject_CallFunctionObjArgs(reversed_meth, NULL);
Py_DECREF(reversed_meth);