[pygtk] gtk.TreeModelRowIter.next
Johan Dahlin
jdahlin at async.com.br
Wed May 17 20:20:43 WST 2006
Brian skrev:
> It says:
>
> When there are no more rows left the StopIteration exception is raised.
>
> But I can't find out any more about the StopIteration. ie. where is it
> defined, where do you import it from. I can't find it in any of the
> gtk.Constants, treeview, treemodel, etc..
>
> The only code I googled up, did not have it defined, just stuck there
> like the following snipit. Google says that kiwi/~/list.py had it but
> that link was dead and the list.py I found did not have it.
>
>
StopIteration is mostly considered as an implementation detail.
It provides a way of stopping an iteration. If you're just trying to
find out how to get the data sequencially from a model, this is how
you do it:
for row in model
At least for gtk.ListStore, gtk.TreeStore is slightly trickier.
Johan
More information about the pygtk
mailing list