Deal with slices passed to __*item__ in Python 3.

This commit is contained in:
Daniele Varrazzo 2010-12-23 03:28:19 +01:00
parent ade1b2cc7b
commit e18f1c63ea

View File

@ -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)