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

2012-12-14 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

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

2012-11-25 Thread Mark Dickinson
Mark Dickinson added the comment: Closing as won't fix. -- resolution: -> wont fix status: open -> closed ___ Python tracker ___ ___

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

2012-11-17 Thread Andrew Svetlov
Changes by Andrew Svetlov : -- nosy: +asvetlov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

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

2012-11-17 Thread Stefan Krah
Stefan Krah added the comment: I don't particularly like OverflowError in any situation where the potential overflow is detected *before* it actually happens. This is another example: >>> x = [1]* Traceback (most recent call last): File "", line 1, in OverflowError: canno

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

2012-11-17 Thread Ramchandra Apte
Ramchandra Apte added the comment: +1 on OverflowError being a subclass of ValueError -- nosy: +ramchandra.apte ___ Python tracker ___ ___

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

2012-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > There's also the minor practical inconvenience of having to remember to catch > OverflowError *and* ValueError in try: .. except: constructs. And MemoryError (for big decimals). Might be the best solution would be raising an exception which subclasses both

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

2012-11-16 Thread Mark Dickinson
Mark Dickinson added the comment: I guess the feeling of wrongness for me mostly comes from the floating-point world, where the IEEE 754 'overflow' floating-point exception is only appropriate for cases where the result is *finite* but so large that it falls outside the representable range for

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

2012-11-15 Thread Case Van Horsen
Case Van Horsen added the comment: I agree that ValueError is a more "correct" exception but I also don't think OverflowError is all that wrong. I don't think the change is worth the risk of breaking existing code. I'd be fine with either option. -- nosy: +casevh

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

2012-11-15 Thread Alexey Kachayev
Alexey Kachayev added the comment: Patch is attached (ported from full issue patch for issue 16469). -- keywords: +patch nosy: +kachayev Added file: http://bugs.python.org/file27993/issue16483.diff ___ Python tracker

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

2012-11-15 Thread Mark Dickinson
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'