diff options
Diffstat (limited to 'Objects/enumobject.c')
-rw-r--r-- | Objects/enumobject.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/enumobject.c b/Objects/enumobject.c index 8b2e6e1..7ed58da 100644 --- a/Objects/enumobject.c +++ b/Objects/enumobject.c @@ -174,8 +174,7 @@ reversed_new(PyTypeObject *type, PyObject *args, PyObject *kwds) if (!PyArg_UnpackTuple(args, "reversed", 1, 1, &seq)) return NULL; - /* Special case optimization for xrange and lists */ - if (PyRange_Check(seq) || PyList_Check(seq)) + if (PyObject_HasAttrString(seq, "__reversed__")) return PyObject_CallMethod(seq, "__reversed__", NULL); if (!PySequence_Check(seq)) { |