Josh Rosenberg <shadowranger+pyt...@gmail.com> added the comment:

"One other issue is that the arguments to prod() need not be integers, so a 
modulus argument wouldn't make sense in those contexts."

The arguments to pow don't need to be integers either, yet the optional third 
argument is only really relevant to integers.

Not saying we should do this, but we definitely allow optional arguments that 
are only meaningful for certain input types in other cases.

The best argument for this change I can come up with from other Python 
functions is the push for an efficient math.comb (#35431); if we didn't want to 
bother supporting minimizing intermediate values, math.comb could be 
implemented directly in terms of math.factorial instead of trying to pre-cancel 
values. But even that's not a strong argument for this, given the relative 
frequency with which each feature is needed (the binomial coefficient coming up 
much more often than modular reduction of huge products).

----------
nosy: +josh.r

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35996>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to