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

Adam Olsen rhamph at gmail.com
Mon Mar 22 06:51:47 CET 2010


On Sun, Mar 21, 2010 at 16:59, Steven D'Aprano <steve at pearwood.info> wrote:
> If naive users are going to use the interpreter as a calculator, they're
> going to start off using floats and ints simply because they require
> less typing. My idea is to allow a gentle learning curve with Decimal
> (and Fraction) without scaring them off with exceptions or excessive
> warnings: a single warning per session would be okay, a warning after
> every operation would be excessive in my opinion, and exceptions by
> default would be right out.

That strikes me as a passive-aggressive way of saying we tolerate it
for interactive use, but don't you dare mix them for real programs.

A warning should be regarded as a bug in real programs — unless it's a
transitional measure — so it might as well be an exception.  Don't
guess and all that.


-- 
Adam Olsen, aka Rhamphoryncus


More information about the Python-Dev mailing list