Yes, a hack: What about setting tp_iternext to PyObject_GetIter? they happen
to have the same signature.
Yes, calling next() will call iter() instead; but an iterator is often its
own iterator, and more importantly, PyIter_Check() is also called.
And the error message is surprisingly almost correct:
"TypeError: iter() returned non-iterator of type 'BadIterator'"
It's not completely correct since the error occurred while calling the
__next__() method of the iterator.
See attached patch for 2.6.
I can see one cause of incompatibility: if someone designed an extension
type in C where tp_iternext is already PyObject_GetIter. It's is insane but
valid, and the patch would break it. It's not worth the trouble I suppose...