Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 545d300

Browse files
committed
Fix duplicated paragraph.
1 parent cc47b05 commit 545d300

1 file changed

Lines changed: 0 additions & 13 deletions

File tree

Doc/howto/functional.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -670,19 +670,6 @@ If the iterable returns no values at all, a :exc:`TypeError` exception is
670670
raised. If the initial value is supplied, it's used as a starting point and
671671
``func(initial_value, A)`` is the first calculation. ::
672672

673-
674-
``reduce(func, iter, [initial_value])`` doesn't have a counterpart in the
675-
:mod:`itertools` module because it cumulatively performs an operation on all the
676-
iterable's elements and therefore can't be applied to infinite iterables.
677-
``func`` must be a function that takes two elements and returns a single value.
678-
:func:`reduce` takes the first two elements A and B returned by the iterator and
679-
calculates ``func(A, B)``. It then requests the third element, C, calculates
680-
``func(func(A, B), C)``, combines this result with the fourth element returned,
681-
and continues until the iterable is exhausted. If the iterable returns no
682-
values at all, a :exc:`TypeError` exception is raised. If the initial value is
683-
supplied, it's used as a starting point and ``func(initial_value, A)`` is the
684-
first calculation.
685-
686673
>>> import operator
687674
>>> reduce(operator.concat, ['A', 'BB', 'C'])
688675
'ABBC'

0 commit comments

Comments
 (0)