[Python-Dev] Decimal.py in sandbox
Aahz
aahz at pythoncraft.com
Wed Oct 29 16:21:59 EST 2003
In article <mailman.211.1067451069.702.python-list at python.org>,
Mike Rovner <mike at bindkey.com> wrote:
>
>Why 5+3. -> 8. ok,
>but Decimal(5)+3 -> 8. is not ok?
>
>I favor implicit conversion as long as first stays true. It's fast
>(no decimal arithmetic), it's understandable, it's in line with other
>numeric.
The problem is that the vast majority of people who use Decimal want
accuracy. Decimal(5)+1.1 does not have an accurate answer. Remind
yourself of this gems from The Python Way:
Explicit is better than implicit.
Errors should never pass silently.
In the face of ambiguity, refuse the temptation to guess.
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"It is easier to optimize correct code than to correct optimized code."
--Bill Harlan
More information about the Python-list
mailing list