[Edu-sig] re: Types and true division (was Re: strange output

Tim Peters tim.one@comcast.net
Mon, 14 Oct 2002 22:04:02 -0400


[Tim]
>> Those folks were the first to bring up the issue forcefully, and Guido
>> recognized the correctness of their conclusion at once.  Figuring out
>> *why* the conclusion was correct stretched out over years, and Guido
>> didn't move to change the language until after his brain caught up
>> with his designer's intuition.

[Art]
> If you are saying that there was a totally serendipitous concurrence by
> which where Randy's and Bruce's forceful statement of the more
> than obvious issues related to 1/2 =0 and the newbie gets Guido to
> thinking, which thinking then lights on:

I don't think what I wrote needs rewording to be clear, and it certainly
won't be clarified by loading up on hyperbole ("totally serendipitous",
"more than obvious", "absolutely nothing" (below)).

> "It has to do with substitutability of equal values with different types.
> When a==A and b==B, then a+b should be == A+B, at least within
> reasonable precision. "
>
> OK, I guess, if you say so.

Minus the hyperbole, that's my view of it.

> But we agree that one thing has absolutely nothing to do with the other.
> Don't we?

I don't know what this means:  there was certainly cause and effect here, so
"absolutely nothing" can't apply.  Design issues are complex, and I doubt
Guido believes that "1/3 == 0" was doing newbies a favor regardless of how
much it pains experienced programmers (in fact, I pissed away an hour this
weeked tracing a subtle bug to exactly that!  the expression exp(-x*x/2) was
subtly wrong in some cases of large x, and it turned out x was being passed
as int in these case several layers above).  There are multiple reasons for
the change, but the one that carries most force now boils down to the
substitutability argument Guido summarized.  Newbies aren't immune from that
bad consequences of that either, of course, although they're far less aware
of them as such.

> And we understand how when total serendipity comes into play, us
> reasonably minded observers can get confused.  No?
>
> So I'm forgivven.
>
> Yes?

I never damned you, Art -- there's nothing to forgive.  You do some mondo
cool things with Python, and outside of this particular topic I value your
presence in our little community.