Message 79084 - Python tracker (original) (raw)
Do you think it would be worth replacing the two uses of conditional expressions in Decimal.from_float with if-else statements?
Yes, please.
Of course, from_float still won't work with earlier versions of Python, but having one Decimal method unavailable seems like a lesser crime than making 'import decimal' fail.
Right. I don't see an easy way around that short of having a conditional compilation, allowing use of alternative slow code multiplying the float repeatedly by two to build-up the float digits.