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