.. versionadded:: 3.4
+.. index:: object: slice
+
.. note::
Slicing is done exclusively with the following three methods. A call like ::
.. method:: object.__getitem__(self, key)
- .. index:: object: slice
-
Called to implement evaluation of ``self[key]``. For sequence types, the
accepted keys should be integers and slice objects. Note that the special
interpretation of negative indexes (if the class wishes to emulate a sequence
indexes to allow proper detection of the end of the sequence.
-.. method:: object.__missing__(self, key)
-
- Called by :class:`dict`\ .\ :meth:`__getitem__` to implement ``self[key]`` for dict subclasses
- when key is not in the dictionary.
-
-
.. method:: object.__setitem__(self, key, value)
Called to implement assignment to ``self[key]``. Same note as for
values as for the :meth:`__getitem__` method.
+.. method:: object.__missing__(self, key)
+
+ Called by :class:`dict`\ .\ :meth:`__getitem__` to implement ``self[key]`` for dict subclasses
+ when key is not in the dictionary.
+
+
.. method:: object.__iter__(self)
This method is called when an iterator is required for a container. This method