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 <>
Python-bugs-list mailing list

Reply via email to