[issue20539] math.factorial may throw OverflowError

Stefan Krah report at bugs.python.org
Fri Feb 7 21:55:08 CET 2014


Stefan Krah added the comment:

I slightly favor the ValueError patch because there is only a single exception
to catch. PyLong_AsUnsignedLong() also raises OverflowError for both positive
values that are too large and for negative values.

Perhaps the error message could contain the actual range of allowed values,
especially since LONG_MAX differs across platforms.

The drawback is that "outrageously" would have to go then. :)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20539>
_______________________________________


More information about the Python-bugs-list mailing list