PEP 238 (revised)

Glyph Lefkowitz glyph at twistedmatrix.com
Fri Jul 27 01:53:51 CEST 2001


>From the peanut gallery: (so of course, feel free to ignore ^_^)

Neither int nor float math is 'real' math.  One could make the argument
that rational math is the only "true" math, but as points have been made
in the past, storage concerns and the lack of closure under certain
operations make rationals impractical.

I don't see a problem with Python's current implementation, and this PEP
does nothing for me but make math on pixels more irritating.  (ints are
wrong and floats are wrong, but at least ints reasonably approximate
screen real estate).

The beginners that I teach Python to are mostly interested in display
hacks in PyGame at this point; teaching them that they need to do int(x/y)
in some cases instead of float(x)/y in others isn't really going to make
the job of teaching any easier; users of numerical libraries *must*
understand the varieties of precision they have at their disposal.  But
this PEP does mean that I have to teach it again and in a different way to
those who already know it, as well as deal with version incompatibility
issues at the level of language semantics (PythonLabs really needs to get
involved with linux distributors to make sure that distributions stay more
current...)

I am unaware of the audience for this PEP, as most of those
discussing it seem to understand the issues but be concerned about
mythical "new users" of the language.  In my experience, real new users
are not confused by the current standard and would not be confused by the
new one, but the change would be harmful.  In short -- this change may
help somebody, and I trust that PythonLabs knows at least one real person
whose life it will make easier; but it will waste a lot of my time.

Whatever it is that PythonLabs decides to do in this instance, please
hammer it into stone.  While I do not relish the idea of reworking all of
my code that uses division now, I'm willing to do it *if it's only this
once*, and there's some real perceived good of mucking with Python's math
internals.  I'll just hope that the million-odd already installed copies
of PYthon 1.5.2 are going to get replaced with 2.2 sometime in the near
future :).  But let's not turn the use of Python itself into a maintenance
or integration nightmare; pick a direction and move forward with it.

On Thu, 26 Jul 2001, Guido van Rossum wrote:

> Here's a completely revised version of PEP 238.  It contains a long
> motivational section, a clear specification of what will happen, and a
> discussion of rejected alternatives, a list of open issues, a Q-and-A
> section etc..  I hope it answers most questions that have been raised
> about this issue.  I'd be happy to revise it if there are still things
> unclear.
> 
> --Guido van Rossum (home page: http://www.python.org/~guido/)

                      ______      __   __  _____  _     _
                     |  ____ |      \_/   |_____] |_____|
                     |_____| |_____  |    |       |     |
                     @ t w i s t e d m a t r i x  . c o m
                     http://twistedmatrix.com/users/glyph






More information about the Python-list mailing list