diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2017-12-11 18:57:48 -0800 |
---|---|---|
committer | Jon Dufresne <jon.dufresne@gmail.com> | 2017-12-11 19:01:38 -0800 |
commit | 3a6a8e96fbcad8e11843b1f3d04d1e0cb9ff4699 (patch) | |
tree | 4d8246bd68cdd5d699b73f913fc188f695822b87 /lib | |
parent | 2cd9a78a97ee787517960ce6f066447e42ef8705 (diff) | |
download | psycopg2-3a6a8e96fbcad8e11843b1f3d04d1e0cb9ff4699.tar.gz |
User super() throughout DictRow class
Avoid calling parent method directly.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/extras.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/extras.py b/lib/extras.py index 68df344..85d94b3 100644 --- a/lib/extras.py +++ b/lib/extras.py @@ -168,12 +168,12 @@ class DictRow(list): def __getitem__(self, x): if not isinstance(x, (int, slice)): x = self._index[x] - return list.__getitem__(self, x) + return super(DictRow, self).__getitem__(x) def __setitem__(self, x, v): if not isinstance(x, (int, slice)): x = self._index[x] - list.__setitem__(self, x, v) + super(DictRow, self).__setitem__(x, v) def items(self): return list(self.iteritems()) @@ -195,13 +195,13 @@ class DictRow(list): def iteritems(self): for n, v in self._index.iteritems(): - yield n, list.__getitem__(self, v) + yield n, super(DictRow, self).__getitem__(v) def iterkeys(self): return self._index.iterkeys() def itervalues(self): - return list.__iter__(self) + return super(DictRow, self).__iter__() def copy(self): return dict(self.iteritems()) |