Message315553
In Python 2, you have to override __getslice__ as well as __getitem__.
Try this instead:
class MyTuple(tuple):
def __getitem__(self, pos):
print "get item {}".format(pos)
return super(MyTuple, self).__getitem__(pos)
def __getslice__(self, *args):
print "get slice {}".format(args)
return super(MyTuple, self).__getslice__(*args)
I don't believe this is a bug. If you try with the above fix, and still believe there is a bug, please feel free to re-open the issue. |
|
Date |
User |
Action |
Args |
2018-04-21 07:21:10 | steven.daprano | set | recipients:
+ steven.daprano, jpthalman |
2018-04-21 07:21:09 | steven.daprano | set | messageid: <1524295269.96.0.682650639539.issue33322@psf.upfronthosting.co.za> |
2018-04-21 07:21:09 | steven.daprano | link | issue33322 messages |
2018-04-21 07:21:09 | steven.daprano | create | |
|