summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-05-07 01:28:47 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-05-07 01:28:47 (GMT)
commit686b14d7ad700cfb3d3f0538695f0aa8e6c1b0b8 (patch)
treee166e888c8dfc6b8257a99d06f7492e52ad91164 /Objects
parenta409f7c491647fe0c256c944d6fe4e9593d15760 (diff)
downloadcpython-686b14d7ad700cfb3d3f0538695f0aa8e6c1b0b8.zip
cpython-686b14d7ad700cfb3d3f0538695f0aa8e6c1b0b8.tar.gz
cpython-686b14d7ad700cfb3d3f0538695f0aa8e6c1b0b8.tar.bz2
SF bug #730296: Unexpected Changes in list Iterator
Reverted a Py2.3b1 change to iterator in subclasses of list and tuple. They had been changed to use __getitem__ whenever it had been overriden in the subclass. This caused some usabilty and performance problems. Also, it was inconsistent with the rest of python where many container methods access the underlying object directly without first checking for an overridden getter. Users needing a change in iterator behavior should override it directly.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/listobject.c2
-rw-r--r--Objects/tupleobject.c2
2 files changed, 0 insertions, 4 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 36bbe22..48f3d7d 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -2382,8 +2382,6 @@ list_iter(PyObject *seq)
PyErr_BadInternalCall();
return NULL;
}
- if (seq->ob_type->tp_as_sequence->sq_item != (intargfunc)list_item)
- return PySeqIter_New(seq);
it = PyObject_GC_New(listiterobject, &PyListIter_Type);
if (it == NULL)
return NULL;
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 7456533..282da3e 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -753,8 +753,6 @@ tuple_iter(PyObject *seq)
PyErr_BadInternalCall();
return NULL;
}
- if (seq->ob_type->tp_as_sequence->sq_item != (intargfunc)tupleitem)
- return PySeqIter_New(seq);
it = PyObject_GC_New(tupleiterobject, &PyTupleIter_Type);
if (it == NULL)
return NULL;