summaryrefslogtreecommitdiffstats
path: root/Doc/library/functions.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-01-06 16:17:56 (GMT)
committerGeorg Brandl <georg@python.org>2008-01-06 16:17:56 (GMT)
commit81de0d24d589251d9465b3a214a9b9adb3962f4a (patch)
tree73e32ee3ced3ed3c1570df034ca3f6df32d91bbe /Doc/library/functions.rst
parentec32b6bce7a9d2c58d1ad040c2cdca34de819634 (diff)
downloadcpython-81de0d24d589251d9465b3a214a9b9adb3962f4a.zip
cpython-81de0d24d589251d9465b3a214a9b9adb3962f4a.tar.gz
cpython-81de0d24d589251d9465b3a214a9b9adb3962f4a.tar.bz2
#1582: document __reversed__, patch by Mark Russell.
Diffstat (limited to 'Doc/library/functions.rst')
-rw-r--r--Doc/library/functions.rst10
1 files changed, 7 insertions, 3 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 4f86fc7..693af64 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -977,12 +977,16 @@ available. They are listed here in alphabetical order.
.. function:: reversed(seq)
- Return a reverse :term:`iterator`. *seq* must be an object which supports
- the sequence protocol (the :meth:`__len__` method and the :meth:`__getitem__`
- method with integer arguments starting at ``0``).
+ Return a reverse :term:`iterator`. *seq* must be an object which has
+ a :meth:`__reversed__` method or supports the sequence protocol (the
+ :meth:`__len__` method and the :meth:`__getitem__` method with integer
+ arguments starting at ``0``).
.. versionadded:: 2.4
+ .. versionchanged:: 2.6
+ Added the possibility to write a custom :meth:`__reversed__` method.
+
.. function:: round(x[, n])