Why isn't Python king of the hill?

Martijn Faassen m.faassen at vet.uu.nl
Sat Jun 2 06:37:59 EDT 2001


Courageous <jkraska1 at san.rr.com> wrote:

>>They all involve numbers with points in them.. and when you do math
>>with them, the answers may be different. That's about the extent
>>of my knowledge.

> While I'm sure you didn't mean it this way, I took the whole of your
> post as a rather damning condemnation. This sort of confusion is
> major bad mo-jo.

I meant my post to be humorous. I'm not condemning the need to have
predictable rounding behavior when dealing with money, and I am not
condemning the need to have fast floating point calculations. I'm
also not condemning the need to have predictable-to-newcomers 
behavior. I think that'd give a motivation for decimals, plain-old-floats and
rationals.

I think the confusion can be minimized by clear documentation, just like
the confusion about unicode (so many encodings) can be.

The 'kinds' PEP is interesting in this respect as well. I haven't studied
it, but it seems to promise some unification in all this, which would be
good. I think it's important who are interested in adding different types
of floats to Python consider this or a like-minded proposal (the ability
to easily switch an entire calculation to using a different type of
floating point number, the ability to have Python complain instantly when you're
not mixing them right).

Regards,

Martijn
-- 
History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?



More information about the Python-list mailing list