diff --git a/lib/extras.py b/lib/extras.py index 85d94b38..64467a8e 100644 --- a/lib/extras.py +++ b/lib/extras.py @@ -176,16 +176,14 @@ class DictRow(list): super(DictRow, self).__setitem__(x, v) def items(self): - return list(self.iteritems()) + for n, v in self._index.iteritems(): + yield n, super(DictRow, self).__getitem__(v) def keys(self): return self._index.keys() def values(self): - return tuple(self[:]) - - def has_key(self, x): - return x in self._index + return super(DictRow, self).__iter__() def get(self, x, default=None): try: @@ -193,16 +191,6 @@ class DictRow(list): except: return default - def iteritems(self): - for n, v in self._index.iteritems(): - yield n, super(DictRow, self).__getitem__(v) - - def iterkeys(self): - return self._index.iterkeys() - - def itervalues(self): - return super(DictRow, self).__iter__() - def copy(self): return dict(self.iteritems()) @@ -216,13 +204,6 @@ class DictRow(list): self[:] = data[0] self._index = data[1] - # drop the crusty Py2 methods - if _sys.version_info[0] > 2: - items = iteritems # noqa - keys = iterkeys # noqa - values = itervalues # noqa - del iteritems, iterkeys, itervalues, has_key - class RealDictConnection(_connection): """A connection that uses `RealDictCursor` automatically."""