diff options
author | Georg Brandl <georg@python.org> | 2008-01-06 16:17:56 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-01-06 16:17:56 (GMT) |
commit | 81de0d24d589251d9465b3a214a9b9adb3962f4a (patch) | |
tree | 73e32ee3ced3ed3c1570df034ca3f6df32d91bbe /Doc/library/functions.rst | |
parent | ec32b6bce7a9d2c58d1ad040c2cdca34de819634 (diff) | |
download | cpython-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.rst | 10 |
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]) |