[Python-Dev] Minutes from the Numeric Coercion dev-day session

Guido van Rossum guido@digicool.com
Mon, 12 Mar 2001 18:19:39 -0500


> With apologies for the delay, here are my notes from the numeric coercion
> day.
> 
> There were many topics which were defined by the Timbot to be within the
> scope of the discussion.  Those included:
> 
>   - Whether numbers should be rationals / binary FP / decimal FP / etc.
>   - Whether there should be support for both exact and inexact computations
>   - What division means.
> 
> There were few "deliverables" at the end of the day, mostly a lot of
> consternation on all sides of the multi-faceted divide, with the impression
> in at least this observer's mind that there are few things more
> controversial than what numbers are for and how they should work.  A few
> things emerged, however:
> 
>   0) There is tension between making math in Python 'understandable' to a
> high-school kid and making math in Python 'useful' to an engineer/scientist.
> 
>   1) We could consider using the new warnings framework for noting things
> which are "dangerous" to do with numbers, such as:
> 
>        - noting that an operation on 'plain' ints resulted in a 'long'
> result.
>        - using == when comparing floating point numbers
> 
>   2) The Fortran notion of "Kind" as an orthogonal notion to "Type" may make
> sense (details to be fleshed out).
> 
>   3) Pythonistas are good at quotes:
> 
>      "You cannot stop people from complaining, but you can influence what
> they
>       complain about." - Tim Peters
> 
>      "The only problem with using rationals for money is that money, is,
>       well, not rational." - Moshe Zadka
> 
>      "Don't get too apoplectic about this." - Tim Peters
> 
>   4) We all agreed that "2" + "23" will not equal "25".
> 
> --david ascher

Thanks for the notes.  I couldn't be at the meeting, but I attended a
post-meeting lunch roundtable, where much of the above confusion was
reiterated for my convenience.  Moshe's three or four PEPs also came
out of that.  One thing we *could* agree to there, after I pressed
some people: 1/2 should return 0.5.  Possibly 1/2 should not be a
binary floating point number -- but then 0.5 shouldn't either, and
whatever happens, these (1/2 and 0.5) should have the same type, be it
rational, binary float, or decimal float.

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