diff options
author | Federico Di Gregorio <fog@initd.org> | 2009-04-19 16:25:12 +0200 |
---|---|---|
committer | Federico Di Gregorio <fog@initd.org> | 2009-04-19 16:25:12 +0200 |
commit | bb77a6912fa413e81adefa829997b31450e97f5e (patch) | |
tree | 347b4d74512d9969ca35332cf7ab2b01084742c7 /lib/extras.py | |
parent | bd19e3148cb7e65d40eff70c95ce4320b8c98bfa (diff) | |
download | psycopg2-bb77a6912fa413e81adefa829997b31450e97f5e.tar.gz |
Added missing dict methods in DictRow
Diffstat (limited to 'lib/extras.py')
-rw-r--r-- | lib/extras.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/extras.py b/lib/extras.py index 4ab62bb..4a845ba 100644 --- a/lib/extras.py +++ b/lib/extras.py @@ -141,6 +141,17 @@ class DictRow(list): for n, v in self._index.items(): yield n, list.__getitem__(self, v) + def iterkeys(self): + return self._index.iterkeys() + + def itervalues(self): + return list.__iter__(self) + + def copy(self): + return dict(self.items()) + + def __contains__(self, x): + return self._index.__contains__(x) class RealDictConnection(_connection): """A connection that uses RealDictCursor automatically.""" |