PEP0238 lament

Gareth McCaughan Gareth.McCaughan at pobox.com
Tue Jul 24 19:41:54 EDT 2001


Guido van Rossum wrote:

> Hm, IMO the problem is different.  Python's numerical model *almost*
> embeds the integers in the floats.  (They should've been called reals,
> but that mistake is too insignificant to want to fix. :-)

I'm glad they weren't, because floats do not have the semantics
of reals. More precisely, the class of floats is very different
from the class of reals, and the operations defined on them
differ considerably from the operations of the same names on
the reals.

There's a similar issue with ints/integers, except that Python
ints are better behaved. Generally when they fail to have the
semantics of integers they do so by raising an exception. The
only, errrm, exceptions I know of to this rule are the
shift operators, and it's sort of reasonable to define
those in terms of bit patterns rather than numbers anyway.
Still, I am glad that Python's single-word integral type
is called "int" rather than "integer"; when ints and longs
are unified the result can be called "integer". :-)

-- 
Gareth McCaughan  Gareth.McCaughan at pobox.com
.sig under construc



More information about the Python-list mailing list