Close issue #16077: fix code example in documentation of reduce() built-in (from docs@).
This commit is contained in:
parent
3e09b14026
commit
fab57ccd13
|
@ -1100,7 +1100,7 @@ available. They are listed here in alphabetical order.
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
raise TypeError('reduce() of empty sequence with no initial value')
|
raise TypeError('reduce() of empty sequence with no initial value')
|
||||||
accum_value = initializer
|
accum_value = initializer
|
||||||
for x in iterable:
|
for x in it:
|
||||||
accum_value = function(accum_value, x)
|
accum_value = function(accum_value, x)
|
||||||
return accum_value
|
return accum_value
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue