[issue2719] Backport next()

Alexander Belopolsky report at bugs.python.org
Wed Apr 30 17:20:59 CEST 2008


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

One more question: What is the rationale for

+	res = (*it->ob_type->tp_iternext)(it);
+	if (res == NULL) {
..
+			PyErr_SetNone(PyExc_StopIteration);
+			return NULL;

?

I would think tp_iternext failing to set an exception should not be 
translated into stop iteration.  Instead, builtin_next() should return 
NULL without an exception set and thus trigger a SystemError.

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2719>
__________________________________


More information about the Python-bugs-list mailing list