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

Guido van Rossum guido@python.org
Wed, 09 Oct 2002 21:23:47 -0400


> I personally don't think the primary reason for changing the behavior
> of / was that it confused newbies.

Correct, it has nothing to do with that (even though newbie confusion
led me to first see the problem).  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.  (Floating point
doesn't even guarantee a+(b+c)==(a+b)+c, but it usually gets something
pretty close -- just realize that "pretty close" is not a transitive
property. :-)

Art needn't bother to reply. :-)

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