diff options
author | Georg Brandl <georg@python.org> | 2007-08-23 20:35:00 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-08-23 20:35:00 (GMT) |
commit | 8d9e84554ebfa4e864e75981bae20fed41094bc9 (patch) | |
tree | cbc579219d03356e57e58cb3be089471fab50186 | |
parent | ac4018ae392459b6866ada5d0792d143d2c7cebc (diff) | |
download | cpython-8d9e84554ebfa4e864e75981bae20fed41094bc9.zip cpython-8d9e84554ebfa4e864e75981bae20fed41094bc9.tar.gz cpython-8d9e84554ebfa4e864e75981bae20fed41094bc9.tar.bz2 |
Bug #1697820: document that the old slice protocol is still used by builtin types.
-rw-r--r-- | Doc/reference/datamodel.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 3e55372..030d1d9 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 |