On Tue, 2003-05-20 at 11:12, Bud P.Bruegger wrote:
> Sorry, I wasn't clear. I need something for the iteration ('in' and
> 'for'). I have since read up a litte and it seems I need __iter__
> (see http://www.python.org/doc/current/ref/sequence-types.html).
Yes. You might look at SQLObject.SelectResults.__inter__ (which is
dull), or DBConnection.DBAPI.iterSelect (which is a generator, and
actually implements SelectResults iteration).
__iter__ can also return an object with a next() method. In comparison
the old __getitem__ technique is a pain.
Ian
|