mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-10 19:16:34 +03:00
Deal with slices passed to __*item__ in Python 3.
This commit is contained in:
parent
ade1b2cc7b
commit
e18f1c63ea
|
@ -141,12 +141,12 @@ class DictRow(list):
|
|||
self[:] = [None] * len(cursor.description)
|
||||
|
||||
def __getitem__(self, x):
|
||||
if not isinstance(x, int):
|
||||
if not isinstance(x, (int, slice)):
|
||||
x = self._index[x]
|
||||
return list.__getitem__(self, x)
|
||||
|
||||
def __setitem__(self, x, v):
|
||||
if not isinstance(x, int):
|
||||
if not isinstance(x, (int, slice)):
|
||||
x = self._index[x]
|
||||
list.__setitem__(self, x, v)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user