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 connelly
Recipients
Date 2004-06-17.21:50:16
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=1039782


I'm not sure what you mean by 'make your classes new-style'.

According to 
http://www.python.org/doc/2.3.4/ref/specialnames.html, the 
__getitem__ method should be used, and the __getslice__ 
method is deprecated.

If you subclass the built-in list type, then the __getitem__ 
method is *not* called when subscripting with a slice.  
Instead, the __getslice__ method is called.  Try it out.

So I can't see any reasonable way to get around this bug.

You can try and modify the class C shown above, so that it 
behaves correctly.  I don't think you will be able to do it 
without putting in special "workaround" code to avoid this 
Python bug.

y = C([1, 2, 3])
>>> print y[-7:-5]         # should be [].

History
Date User Action Args
2008-01-20 09:56:57adminlinkissue974635 messages
2008-01-20 09:56:57admincreate