proposed language change to int/int==float (was: PEP0238 lament)
Aahz Maruch
aahz at panix.com
Fri Jul 27 21:02:39 EDT 2001
In article <slrn9m3q54.1c5.Gareth.McCaughan at g.local>,
Gareth McCaughan <Gareth.McCaughan at pobox.com> wrote:
>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.
If I ever get finished with Decimal.py, we'll likely make such numbers
into arbitrary-precision decimal numbers instead of binary floating
point.
[I keep talking about it in public to provide myself with one more
motivation to finish. ;-)]
--
--- Aahz <*> (Copyright 2001 by aahz at pobox.com)
Hugs and backrubs -- I break Rule 6 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista
Fortune cookie: Watch your relations with other people carefully, be reserved.
More information about the Python-list
mailing list