[New-bugs-announce] [issue18841] math.isfinite fails with Decimal sNAN

Steven D'Aprano report at bugs.python.org
Mon Aug 26 17:38:40 CEST 2013

New submission from Steven D'Aprano:

math.isfinite currently raises ValueError when given a Decimal sNAN (signalling NAN).

I've run into a situation where I'm calling isfinite() on a numeric value which may be a Decimal sNAN, and it would be nice if it returned False.

On the other hand, see the discussion on issue 15544, which possibly leads to the conclusion that raising ValueError is the right thing to do.


Either way, behaviour should be documented.

assignee: docs at python
components: Documentation, Library (Lib)
messages: 196213
nosy: docs at python, stevenjd
priority: normal
severity: normal
status: open
title: math.isfinite fails with Decimal sNAN
type: behavior
versions: Python 3.4

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list