[Python-Dev] Mixing float and Decimal -- thread reboot

Nick Coghlan ncoghlan at gmail.com
Mon Mar 22 11:32:35 CET 2010


Mark Dickinson wrote:
> But the Fraction type is going to mess this up:  for Decimal +
> Fraction ->  Decimal, I don't see any other sensible option than to
> convert the Fraction using the current context, since lossless
> conversion isn't generally possible.

Be able to duck this question was precisely why I put Decimal to the
left of Fraction in my pragmatic tower, btw. There are all sorts of good
reasons why that order was mathematically wrong (Real vs Rational,
representability of NaN/Inf, etc), but from the point of view of
providing clearly defined behaviour for an atypical operation, it should
be a lot easier.

Cheers,
Nick.
-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------


More information about the Python-Dev mailing list