Allow functools.reduce
s 'initial' to be a keyword argument
#125916
Labels
functools.reduce
s 'initial' to be a keyword argument
#125916
Feature or enhancement
Proposal:
functools.reduce
takesfunction
(generally a callable) anditerable
, with an optionalinitial
parameter:https://docs.python.org/3/library/functools.html#functools.reduce
However,
initial
cannot be passed as a keyword argument, which reduces ;) readability,Allowing
initial
as keyword argument will be more clear, andinitial
could also be passed as a keyword argument while makingpartial
functions out ofreduce
.Has this already been discussed elsewhere?
I have already discussed this feature proposal on Discourse
Links to previous discussion of this feature:
https://discuss.python.org/t/remove-positional-only-restriction-on-initial-parameter-of-reduce/68897
Linked PRs
The text was updated successfully, but these errors were encountered: