float / double support in Python?

Martijn Faassen m.faassen at vet.uu.nl
Wed Feb 12 06:31:26 EST 2003


Brandon Van Every <vanevery at 3dprogrammer.com> wrote:
> Andrew Bennetts wrote:
>>
>> The problem being that the more low-level bits Python directly
>> supports, the less productive it is, because it forces you to care
>> about the low-level bits.  That probably suits you; but for the bulk
>> of Python programmers the difference between float and double is just
>> an annoyance that would get in the way.
> 
> How are you "forced" to care?

I'd say in C++ you're forced to care. You get things like "Large Scale
C++ Programming", a great book, but dealing with lots of low level details
("don't use unsigned in the interface", "don't use short in the
interface") that obviously Lakos and his readers *do* care about. 
A language feature that is there will have to be considered for use.
Float versus double will make people wonder about what to use, and
what happens on the intersection when converting the one to the other,
and what happens on a library boundary where the library writer used
float throughout and I used double, is anything going to go wrong, etc.

>> I use Python *because* it abstracts away these details, because
>> mostly they don't matter.
> 
> The more abstraction for abstraction's sake, the more the language is
> marginalized from significant areas of real world industrial use.  If you
> want a language to be more popular, implement all basic machine types.

Obviously Python has mechanisms (like the struct and array modules) to get to 
basic machine types. They're just not a core part of the language but
are in libraries, where they belong. :)

Remember that Python is often used as a glue language.

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