Skip to content

Commit 64fee44

Browse files
author
James William Pye
committed
Fix Row.__getitem__ for slices.
1 parent 5277ccc commit 64fee44

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

postgresql/documentation/changes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Changes
2222
ambiguous KeyError due there being no message string for that particular
2323
errno. Add an appropriate message string fallback on a default message when
2424
a specific one doesn't exist.
25+
* Fix slice() support in Row.__getitem__.
2526

2627

2728
0.9.1 released on 2009-08-12

postgresql/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ def from_sequence(typ, keymap, seq):
741741
return r
742742

743743
def __getitem__(self, i):
744-
if type(i) is int:
744+
if isinstance(i, (int, slice)):
745745
return tuple.__getitem__(self, i)
746746
idx = self.keymap[i]
747747
return tuple.__getitem__(self, idx)

0 commit comments

Comments
 (0)