Mark Dickinson added the comment: 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. ---------- nosy: +marketdickinson __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2041> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com