From 686b14d7ad700cfb3d3f0538695f0aa8e6c1b0b8 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 7 May 2003 01:28:47 +0000 Subject: 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. --- Objects/tupleobject.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'Objects/tupleobject.c') diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 7456533ccd..282da3e8b9 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; -- cgit v1.2.1