M
Mike Meyer
Nick Coghlan said:Actually, I was misremembering how Decimal worked - it follows the rule you suggest:
float() + Decimal() fails with a TypeError
float() + float(Decimal()) works fine
And I believe Decimal's __float__ operation is a 'best effort' kind of
thing, so I have no problem with Rationals working the same way.
Actually, I suggested that:
float() + Rational() returns float
You're suggesting that the implicit conversion to float not happen
here, and the user be forced to cast it to float? And you're saying
Decimal does it that way.[
That's good enough for me.
<mike