Rationale for core Python numeric types

Aahz aahz at pythoncraft.com
Wed Jun 16 19:40:01 EDT 2004


In article <d0k0d0l210aq7tut9tdhj8iovusks68kia at 4ax.com>,
Matt Feinstein  <nospam at here.com> wrote:
>
>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?

As Peter said, use the struct module to get data in/out of specific
binary formats.  Other than that, what do you need those datatypes for?

The rationale is that most Python programs don't need that functionality,
and it's much more productive to stick with a few basic types that give
maximum range of functionality.  Python 3.0 won't even offer a fixed-size
integer type -- it'll all be the unbounded Python long type (mostly --
there will be some internal optimizations, probably, but nothing that the
Python user will be able to detect).
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Typing is cheap.  Thinking is expensive."  --Roy Smith, c.l.py



More information about the Python-list mailing list