diff options
Diffstat (limited to 'Doc/reference')
-rw-r--r-- | Doc/reference/datamodel.rst | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 83d2358..2161706 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1700,11 +1700,11 @@ through the container; for mappings, :meth:`__iter__` should be the same as reverse iteration. It should return a new iterator object that iterates over all the objects in the container in reverse order. - If the :meth:`__reversed__` method is not provided, the - :func:`reversed` builtin will fall back to using the sequence protocol - (:meth:`__len__` and :meth:`__getitem__`). Objects should normally - only provide :meth:`__reversed__` if they do not support the sequence - protocol and an efficient implementation of reverse iteration is possible. + If the :meth:`__reversed__` method is not provided, the :func:`reversed` + builtin will fall back to using the sequence protocol (:meth:`__len__` and + :meth:`__getitem__`). Objects that support the sequence protocol should + only provide :meth:`__reversed__` if they can provide an implementation + that is more efficient than the one provided by :func:`reversed`. The membership test operators (:keyword:`in` and :keyword:`not in`) are normally |