This project is archived and is in readonly mode.
Row type is not the expected one, depending on the used factory connection
-
Daniele Varrazzo
- State changed from new to invalid
cursor.next() is not part of the public interface, but an implementation detail: the cursor is iterable (you can call iter() on it), the fact it is also an iterator (exposing next()) is an implementation detail which may also change in the future.
The artefacts you are seeing are due to
__iter__not being called before next(): the latter should only be called as part of the iteration protocol; the only well defined behaviour is that:cur = ... cur.execute(SQL) i = iter(cur) i.next()works as expected for any cursor type.
The fact
next()is not called__next__(), thus resembling a public method, has been acknowledged as a python design mistake: see http://www.python.org/dev/peps/pep-3114/.