diff options
author | Georg Brandl <georg@python.org> | 2009-05-16 11:13:21 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-05-16 11:13:21 (GMT) |
commit | 8dc3b445ece0bd9a9cd7c0abad2e62c02074e512 (patch) | |
tree | 74219084a5f3d0607d37007af7580aaa3a388cb4 | |
parent | f541378d13e7750b67758b721e862fd3b27e9e6b (diff) | |
download | cpython-8dc3b445ece0bd9a9cd7c0abad2e62c02074e512.zip cpython-8dc3b445ece0bd9a9cd7c0abad2e62c02074e512.tar.gz cpython-8dc3b445ece0bd9a9cd7c0abad2e62c02074e512.tar.bz2 |
#6034: clarify __reversed__ doc.
-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 b87909d..5d612b8 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1869,11 +1869,11 @@ sequences, it should iterate through the values. 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`. .. versionadded:: 2.6 |