[New-bugs-announce] [issue16483] Make int(float('inf')) raise ValueError rather than OverflowError.
report at bugs.python.org
Thu Nov 15 22:17:12 CET 2012
New submission from Mark Dickinson:
[Broken out of the issue 16469 discussion about infinity -> Fraction and nan -> Fraction conversions.]
Conversions from float('inf') or Decimal('inf') to int (or Fraction) currently generate an OverflowError, while conversions from nan give a ValueError. I'm of the opinion that it would make more sense for both conversions to generate ValueError, and I'm opening this issue to track discussion for that. There's also a reasonable case that the behaviour is fine as it is, and there's little to be gained by changing it.
title: Make int(float('inf')) raise ValueError rather than OverflowError.
versions: Python 3.4
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce