Python from Wise Guy's Viewpoint

ketil+news at ii.uib.no ketil+news at ii.uib.no
Wed Oct 29 03:21:24 EST 2003


Matthias Blume <find at my.address.elsewhere> writes:

>> - 1 * 1.0;
>> val it = 1.0 : float  (* ideally *)

> That's not "ideal" at all, to me.  I find the automatic conversions in
> C a paint in the b*tt

You're making the mistake of comparing to C :-)  And it's much worse
in C++, when conversions in conjunction with overloading can impact
which function gets called in non-obvious ways.

Anyway, I think Haskell makes this work better.  Still no automatic
conversions, but more flexibility in the use of numeric literals.
Occasionally, you need to sprinkle "fromIntegral"s around in
expressions, which I agree aren't terribly pretty.

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants




More information about the Python-list mailing list