Message104148
It looks like a bug, because __getslice__ is deprecated since 2.0.
If you subclass a builtin type and override the __getitem__ method, you need to override the (deprecated) __getslice__ method too.
And if you run your program with "python -3", it
Example script:
class Upper(unicode):
def __getitem__(self, index):
return unicode.__getitem__(self, index).upper()
#def __getslice__(self, i, j):
#return self[i:j:]
if __name__ == '__main__':
text = Upper('Lorem ipsum')
print text[:]
print text[::] |
|
Date |
User |
Action |
Args |
2010-04-25 17:01:54 | flox | set | recipients:
+ flox |
2010-04-25 17:01:53 | flox | set | messageid: <1272214913.44.0.488253042315.issue8529@psf.upfronthosting.co.za> |
2010-04-25 17:01:51 | flox | link | issue8529 messages |
2010-04-25 17:01:50 | flox | create | |
|