This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author flox
Recipients flox
Date 2010-04-25.17:01:50
SpamBayes Score 1.2040374e-10
Marked as misclassified No
Message-id <1272214913.44.0.488253042315.issue8529@psf.upfronthosting.co.za>
In-reply-to
Content
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[::]
History
Date User Action Args
2010-04-25 17:01:54floxsetrecipients: + flox
2010-04-25 17:01:53floxsetmessageid: <1272214913.44.0.488253042315.issue8529@psf.upfronthosting.co.za>
2010-04-25 17:01:51floxlinkissue8529 messages
2010-04-25 17:01:50floxcreate