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

Bjorn Pettersen BPettersen at NAREX.com
Tue Jul 24 11:44:57 EDT 2001


> From: Klaus-G. Meyer [mailto:klaus-gerd.meyer at de.bosch.com]
> 
> > those guys.  It *is* odd to have to do something like:
> >   x = float(y)/z
> > to get best-possible division in Python.
> 
> But what is with the "best possible" multiplication?
> 
> 99999*99999 -> integer overflow
> 
> Why not an long integer result? (or maybe float)
> 
> You must explicit type:
> 99999*99999L  or  99999*99999.
> 
> Is that not the same thing as type 1./3  ???

I think perhaps an equally interesting example is something like:

  2L**128/2

which currently gives an exact result, but under the proposed new
semantics would give an approximation...

This is only one of the reasons why I think it's a mistake to look at
integer division by itself. If we're going to change basic behaviors it
would be better if we had a consistent semantic model first.

-- bjorn




More information about the Python-list mailing list