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 mark.dickinson
Recipients mark.dickinson, stefan
Date 2008-02-07.18:44:22
SpamBayes Score 0.002025661
Marked as misclassified No
Message-id <1202409862.94.0.130597810606.issue2041@psf.upfronthosting.co.za>
In-reply-to
Content
I think the docs do a good job of explaining this;  in particular, they 
say, 
in http://docs.python.org/dev/reference/datamodel.html#special-method-
names:

"However, built-in types in CPython currently still implement 
__getslice__()."

and explain that __getslice__ is used only to implement the form a[i:j], 
and 
falls back to __getitem__ if __getslice__ is not implemented.

Getting rid of __getslice__ for builtin types in Python 2.x is probably 
one 
of those things that would break backwards compatibility.  And leaving 
it in 
is pretty harmless.  To avoid surprises, don't implement __getslice__ in 
your 
own classes.  But note that __getslice__ and friends are gone in Python 
3.0.

I'd recommend closing this as invalid, but I'll wait for a second 
opinion.
History
Date User Action Args
2008-02-07 18:44:23mark.dickinsonsetspambayes_score: 0.00202566 -> 0.002025661
recipients: + mark.dickinson, stefan
2008-02-07 18:44:22mark.dickinsonsetspambayes_score: 0.00202566 -> 0.00202566
messageid: <1202409862.94.0.130597810606.issue2041@psf.upfronthosting.co.za>
2008-02-07 18:44:22mark.dickinsonlinkissue2041 messages
2008-02-07 18:44:22mark.dickinsoncreate