[Python-checkins] r72675 - python/trunk/Doc/reference/datamodel.rst

georg.brandl python-checkins at python.org
Sat May 16 13:13:22 CEST 2009


Author: georg.brandl
Date: Sat May 16 13:13:21 2009
New Revision: 72675

Log:
#6034: clarify __reversed__ doc.

Modified:
   python/trunk/Doc/reference/datamodel.rst

Modified: python/trunk/Doc/reference/datamodel.rst
==============================================================================
--- python/trunk/Doc/reference/datamodel.rst	(original)
+++ python/trunk/Doc/reference/datamodel.rst	Sat May 16 13:13:21 2009
@@ -1869,11 +1869,11 @@
    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
 


More information about the Python-checkins mailing list