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

Gareth McCaughan Gareth.McCaughan at pobox.com
Fri Jul 27 18:18:12 EDT 2001


Guido van Rossum wrote:

[Tim Hochberg:]
> > 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.

I am a fan of rationals, but I strongly agree. Turning 0.98
into 49/50 is likely to cause much more confusion than it
saves.

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



More information about the Python-list mailing list