[Python-Dev] PEP 0484 - the Numeric Tower (original) (raw)

Steven D'Aprano steve at pearwood.info
Tue Oct 13 20:08:07 EDT 2015


On Tue, Oct 13, 2015 at 04:37:43PM -0700, Raymond Hettinger wrote:

We could have (and still could) make the choice to always coerce to decimal (every float is exactly representable in decimal). Further, any decimal float or binary float could be losslessly coerced to a Fraction, but that probably isn't what you really want most of the time. I think people who work in decimal usually want to stay there and people who work with binary floating point want to stay there as well (invisible coercions being more likely to cause pain than relieve pain).

Further to what Raymond says, if anyone wants to persue this further, and wants to argue for such automatic promotion of float to Decimal (or vice versa), I think a good place to start would be a survey of other languages with a numeric tower. How do they handle similar situations?

-- Steve



More information about the Python-Dev mailing list