3 ms·
> I wish python and other high level languages defaulted to decimal for the literals, and made float something you had to do explicitly. When Python originally
by pdonis 4y ago
> I wish python and other high level languages defaulted to decimal for the literals, and made float something you had to do explicitly.
When Python originally made the choice to have literals with decimal points in them be floats, the language did not have a decimal implementation, so floats were the only choice.
I don't know if anyone has proposed changing the default now that Python does have a decimal implementation, but I suspect that such a proposal would be rejected by the Python developers as breaking too much existing code.
What would be almost as nice, and would be backwards compatible, would be introducing a more compact way to declare decimal literals, something like "0.1d".