[New-bugs-announce] [issue16483] Make int(float('inf')) raise ValueError rather than OverflowError.

Mark Dickinson 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.

----------
messages: 175642
nosy: mark.dickinson
priority: normal
severity: normal
status: open
title: Make int(float('inf')) raise ValueError rather than OverflowError.
type: enhancement
versions: Python 3.4

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


More information about the New-bugs-announce mailing list