From 8d9e84554ebfa4e864e75981bae20fed41094bc9 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 23 Aug 2007 20:35:00 +0000 Subject: [PATCH] Bug #1697820: document that the old slice protocol is still used by builtin types. --- Doc/reference/datamodel.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 3e553724384..030d1d9272a 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1819,6 +1819,9 @@ objects. Immutable sequences methods should at most only define .. deprecated:: 2.0 Support slice objects as parameters to the :meth:`__getitem__` method. + (However, built-in types in CPython currently still implement + :meth:`__getslice__`. Therefore, you have to override it in derived + classes when implementing slicing.) Called to implement evaluation of ``self[i:j]``. The returned object should be of the same type as *self*. Note that missing *i* or *j* in the slice