[issue16469] Exceptions raised by Fraction() different from those raised by int()

Martin v. Löwis report at bugs.python.org
Wed Nov 14 16:09:39 CET 2012


Martin v. Löwis added the comment:

The description of OverflowError is that is is "raised when the result of an arithmetic operation is too large to be represented", so it doesn't actually need to overflow. Still, I see that ∞ actually isn't too large to be represented (and the documentation points out that integer operations will raise MemoryError instead of OverflowError). So yes, ValueError seems more appropriate.

+1 for fixing this in 3.4, only.

----------
nosy: +loewis

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


More information about the Python-bugs-list mailing list