proposed language change to int/int==float (was: PEP0238 lament)

Grant Edwards grante at
Thu Jul 26 23:44:51 CEST 2001

In article <cp3d7j75jv.fsf at>, Guido van Rossum wrote:

>> >>> 1+2
>> 3
>> >>> 1.0+2.0
>> 3.0
>> >>> 
>> ... unless 3 and 3.0 are "the same value".  In which case my
>> definition of that phrase is merely different than yours.
>Well, they have the same *mathemtical* value, and Python does its
>darndest to treat them as equal everywhere.

I've been thinking in assembly language too long. :) In my
mind, floats and ints are only distantly related.

>For example, a dict with int keys can be indexed with
>corresponding float or complex values.

That's interesting -- I didn't know that.

>Exceptions are operations that intrinsically require ints, e.g. list
>indexing.  (This would change under a unified numeric system though, I
>expect, unless inexact numbers are excluded from being used as
>sequence indices.)

If the numerical types all get unified, then I think one would
expect an inexact number to get "converted" to an exact one if
used in that context.

Grant Edwards                   grante             Yow!  I guess it was all a
                                  at               DREAM... or an episode of
                                 HAWAII FIVE-O...

More information about the Python-list mailing list