From: Georg Brandl Date: Thu, 23 Aug 2007 20:35:00 +0000 (+0000) Subject: Bug #1697820: document that the old slice protocol is still used by builtin types. X-Git-Tag: v2.6a1~1456 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8d9e84554ebfa4e864e75981bae20fed41094bc9;p=python Bug #1697820: document that the old slice protocol is still used by builtin types. --- diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 3e55372438..030d1d9272 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