[issue25735] math.factorial doc should mention integer return type
Terry J. Reedy
report at bugs.python.org
Fri Nov 27 14:53:29 EST 2015
Terry J. Reedy added the comment:
I agree. In testing, I discovered this bug
>>> factorial(decimal.Decimal(5.2))
120
I don't know if this is a glitch in factorial or Decimal.
I also noticed
>>> fac(fractions.Fraction(4, 1))
Traceback (most recent call last):
File "<pyshell#10>", line 1, in <module>
fac(fractions.Fraction(4, 1))
TypeError: an integer is required (got type Fraction)
Perhaps this is due to no __int__ method.
----------
nosy: +facundobatista, mark.dickinson, rhettinger, skrah, terry.reedy
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25735>
_______________________________________
More information about the Python-bugs-list
mailing list