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

Guido van Rossum guido at python.org
Fri Jul 27 09:33:58 EDT 2001


David Eppstein <eppstein at ics.uci.edu> writes:

> In article <U_387.50579$Cy.6523947 at news1.rdc1.az.home.com>,
>  "Tim Hochberg" <tim.hochberg at ieee.org> wrote:
> 
> >    * Addition of a rational literal (PEP 240)? This one you could easily
> > dislike a lot. But if your really super concerned about the evils of
> > inexatitude, you'll probably like this more than I do.
> 
> Actually, I do dislike this.  Much as I find floats generally useless, I 
> think that 0.666667 should return a float, and that if I want to write a 
> rational literal I should be able to write it as 2/3.

I think you're right.  An early version of ABC worked like this, and
at the time I though "hmm, but why shouldn't 0.98 be an exact number;
it could be intended as a price or something like that", and I
convinced the team to change it.  But in practice it was more often
annoying.  Now maybe that was because we (the biggest users) were CS
and math folks, and we tended to tackle typical math and CS problems
-- but my gut is to vote against this aspect of the PEP.

> Also it is odd that the abstract discusses modifying division to
> return rationals but that the rest of the PEP is entirely about what
> to do with decimal strings.

Most of the numeric PEPs need to be rewritten to give more motivation
and more choices and more details, but that's a lot of work...  Want
to help?

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-list mailing list