[Python-Dev] Not-a-Number (was PyObject_RichCompareBool identity shortcut)

Alexander Belopolsky alexander.belopolsky at gmail.com
Fri Apr 29 19:35:41 CEST 2011


On Fri, Apr 29, 2011 at 1:11 PM, Guido van Rossum <guido at python.org> wrote:
> … Would it make sense to add
> a float context that also lets one specify what should happen? That
> could include returning Inf for 1.0/0.0 (for experts), or raising
> exceptions when NaNs are produced (for the numerically naive like
> myself).

ISTM, this is approaching py4k territory.  Adding contexts will not
solve backward compatibility problem unless you introduce a "quirks"
contexts that would preserve current warts and make it default.

For what it's worth, I think the next major version of Python should
use decimal as its main floating point type an leave binary floats to
numerical experts.


More information about the Python-Dev mailing list