[Gabriel Genellina] > This time, the ((tuple) and None) is like saying "discard the tuple and > return None instead", and that fires the usual StopIteration.
It looks like the offending code is in the gen_send_ex() function in Objects/genobject.c: if (result == Py_None && f->f_stacktop == NULL) { Py_DECREF(result); result = NULL; /* Set exception if not called by gen_iternext() */ if (arg) PyErr_SetNone(PyExc_StopIteration); } The conditional should probably be: if (result 1= NULL && f->f_stacktop == NULL) Please open a bug report on SF and assign to me. Raymond Hettinger -- http://mail.python.org/mailman/listinfo/python-list