Rationale for core Python numeric types

Terry Reedy tjreedy at udel.edu
Thu Jun 17 16:41:34 CEST 2004


"Matt Feinstein" <nospam at here.com> wrote in message
news:d0k0d0l210aq7tut9tdhj8iovusks68kia at 4ax.com...
> Hi all--
>
> 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?

By design, Python is as much or more a human-readable algorithm language as
a machine-readable linear-ram computer programming language.  From an
algorithmic/mathematical viewpoint, the number types are counts, integers,
rationals, reals, complexes, etc.  From this viewpoint, byte-lengths are
machine-implementation details, not number types.  So yes, they are
relegated to optional extensions for those who need them.  Note that
calculators do not (typically at least) even have separate integral and
rational/real types.

Terry J. Reedy







More information about the Python-list mailing list