From fe04062e19628ab285eea4a55118dad5d801b3e2 Mon Sep 17 00:00:00 2001 From: ntt Date: Wed, 25 Jan 2012 20:24:10 +0100 Subject: [PATCH] adding iterator to FilterRowset class --- src/util.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/util.py b/src/util.py index 9f59b9d..232cfa4 100644 --- a/src/util.py +++ b/src/util.py @@ -15,6 +15,7 @@ import time import math import cPickle +import _weakref from . import _os @@ -295,6 +296,10 @@ def Sort(self, colname): ret = Rowset(self.header, self.items.values(), self.RowClass) return ret.Sort(colname) + def __iter__(self): + return (self[key] for key in self.iterkeys()) + + class IndexedRowLists(dict): __guid__ = 'util.IndexedRowLists'