PEP 238 (revised)

Gareth McCaughan Gareth.McCaughan at pobox.com
Fri Jul 27 18:55:37 EDT 2001


Guido van Rossum wrote:
> Here's a completely revised version of PEP 238.
[...]

+0.9. Quibbles:

  - "analized" should be "analysed" (NB not "analyzed", please)

  - I cannot bring myself to like 2/1 -> 2.0

  - putting "-Dold" and "-Dnew" in the language until version
    3.000 [:-)] feels bad; something more extensible would be
    better

  - "many contexts ... don't have a clear float or integer
    context" is nasty. Replace the end with "... can't sensibly
    be classified as preferring either integers or floats",
    maybe.

  - the reasoning behind rejecting "/ = classical, // = float"
    is broken. Maybe something like:

      | - Let / keep its classic semantics; introduce // for
      |   true division. This does not solve the problem that
      |   the operator written as "/" has semantics very
      |   different from those of mathematical division.
      |   Furthermore, we believe that true division is needed
      |   more often than floor division, and it should therefore
      |   have the more familiar and shorter name. This is
      |   also likely to be less confusing for newcomers to
      |   Python.

  - Something is strained about the grammar of the last
    sentence of the answer to the first question in the
    FAQ. I suggest replacing it with something like

      | Note that for both positive and negative integers,
      | classic and floor division round towards negative
      | infinity, whereas the int() function rounds
      | towards zero. (divmod() rounds towards negative
      | infinity.)

I don't like "quotient" for the result of floor-division;
to me, "quotient" means the result of "true division".

"True division" is better than "real division" and you
should not be deterred from using it by the fact that
some people think it prejudges the question.

Since so many people are asking about conversion tools,
the matter should be addressed briefly in the FAQ at the
end.

-- 
Gareth McCaughan  Gareth.McCaughan at pobox.com
.sig under construc



More information about the Python-list mailing list