[Python-3000-checkins] r61896 - python/branches/py3k/Doc/howto/functional.rst

georg.brandl python-3000-checkins at python.org
Tue Mar 25 16:33:32 CET 2008


Author: georg.brandl
Date: Tue Mar 25 16:33:31 2008
New Revision: 61896

Modified:
   python/branches/py3k/Doc/howto/functional.rst
Log:
Fix duplicated paragraph.


Modified: python/branches/py3k/Doc/howto/functional.rst
==============================================================================
--- python/branches/py3k/Doc/howto/functional.rst	(original)
+++ python/branches/py3k/Doc/howto/functional.rst	Tue Mar 25 16:33:31 2008
@@ -670,19 +670,6 @@
 raised.  If the initial value is supplied, it's used as a starting point and
 ``func(initial_value, A)`` is the first calculation. ::
 
-
-``reduce(func, iter, [initial_value])`` doesn't have a counterpart in the
-:mod:`itertools` module because it cumulatively performs an operation on all the
-iterable's elements and therefore can't be applied to infinite iterables.
-``func`` must be a function that takes two elements and returns a single value.
-:func:`reduce` takes the first two elements A and B returned by the iterator and
-calculates ``func(A, B)``.  It then requests the third element, C, calculates
-``func(func(A, B), C)``, combines this result with the fourth element returned,
-and continues until the iterable is exhausted.  If the iterable returns no
-values at all, a :exc:`TypeError` exception is raised.  If the initial value is
-supplied, it's used as a starting point and ``func(initial_value, A)`` is the
-first calculation.
-
     >>> import operator
     >>> reduce(operator.concat, ['A', 'BB', 'C'])
     'ABBC'


More information about the Python-3000-checkins mailing list