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

Adam Olsen rhamph at gmail.com
Sun Mar 21 20:21:46 CET 2010


On Sun, Mar 21, 2010 at 00:58, Nick Coghlan <ncoghlan at gmail.com> wrote:
> I don't actually mind either way - the pragmatic tower is about coding
> convenience rather than numeric purity (and mixing Fractions and
> Decimals in the same algorithm is somewhat nonsensical - they're
> designed for two completely different problem domains).

I think the rule I've been going on is that ideal types (int,
Fraction) are on one end and pragmatic types (float, complex) are on
the other.  Since Decimal can be used exactly it clearly bridges both
groups.

*However*, there's other possible types out there, and would they fit
into my system?  I've just taken a look at sympy and although it's
clearly an ideal type, it also allows mixing with float and complex,
both producing sympy types.  That puts it clearly past float and
complex in the tower.

I have no ideal where Decimal should go.


-- 
Adam Olsen, aka Rhamphoryncus


More information about the Python-Dev mailing list