[issue3720] segfault in for loop with evil iterator

Raymond Hettinger report at bugs.python.org
Sun Aug 31 05:20:25 CEST 2008


Raymond Hettinger <rhettinger at users.sourceforge.net> added the comment:

The next-nevernull patch is much cleaner than I expected.  Nice work.

The assertion in abstract.c can be changed to:
   assert(iter==PyObject_NextNotImplemented || PyIter_Check(iter));

Armin, are you happy with the new approach?  Though "del obj.next" 
isn't doing exactly what you would expect, that seems harmless to me.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3720>
_______________________________________


More information about the Python-bugs-list mailing list