Rationale for core Python numeric types

Peter Hansen peter at engcorp.com
Fri Jul 16 14:59:54 CEST 2004


M. Feinstein wrote:
> Matt Feinstein <nospam at here.com> wrote in message news:<d0k0d0l210aq7tut9tdhj8iovusks68kia at 4ax.com>...
> 
>>I'm new to Python, and was somewhat taken aback to discover that the
>>core language lacks some basic numerical types (e.g., single-precision
>>float, short integers). I realize that there are extensions that add
>>these types-- But what's the rationale for leaving them out? Have I
>>wandered into a zone in the space/time continuum where people never
>>have to read binary data files?
> 
> I don't want to get all pissy about this, but apart from some useful
> pointers about how to deal with binary data and some not-so-useful
> suggestions about what I should go do with my problems, no one has
> answered my original question. Should I conclude that there is no
> rationale for core Python numeric types? Should I just go dunk my head
> in a pail of water and take a deep breath?

Yep, do the dunk...  I don't know if it was answered clearly enough,
but basically you don't need them even though you think you do, in
probably almost any case you can come up with.

I think my answer probably covered everything you need to know.
Now you just need to spend some time writing real Python apps
to show you all the ways in which you *don't* actually need
things like "single-precision float" and "short int".

By the way, I write all kinds of industrial control and embedded
stuff and I have the same needs as you (probably) do.  And I
do NOT need such things in Python for these tasks, even though
the tasks themselves sometimes need them.  My first response
in this thread tells the secret to why this could be so. ;-)

-Peter



More information about the Python-list mailing list