mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-10 19:16:34 +03:00
Added missing dict methods in DictRow
This commit is contained in:
parent
bd19e3148c
commit
bb77a6912f
|
@ -1,3 +1,8 @@
|
|||
2009-04-19 Federico Di Gregorio <fog@initd.org>
|
||||
|
||||
* lib/extras.py: patch from Marko Kreen to implement missing dict
|
||||
methods in DictRow.
|
||||
|
||||
2009-04-04 Federico Di Gregorio <fog@initd.org>
|
||||
|
||||
* connection_int.c(conn_notice_callback): removed all Python
|
||||
|
|
|
@ -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."""
|
||||
|
|
Loading…
Reference in New Issue
Block a user