Title: classic division in demos/ directory
Type: Stage:
Components: Demos and Tools Versions:
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, exarkun, gvanrossum, rhettinger, schuppenies
Priority: low Keywords: easy, patch

Created on 2003-02-16 22:27 by exarkun, last changed 2008-09-13 02:00 by akuchling. This issue is now closed.

File name Uploaded Description Edit
demo_classicdivision.diff schuppenies, 2008-03-02 15:59
Messages (5)
msg14619 - (view) Author: Jean-Paul Calderone (exarkun) * (Python committer) Date: 2003-02-16 22:27
PEP 238 states:

     - The standard library will use the future
division statement and
       the // operator when appropriate, so as to
completely avoid
       classic division.

  While the demos/ directory is not technically part of
the standard library, it does contain code that should
work, and that newbies may examine in the course of
learning Python.  Python source there should follow the
same rules as anyplace else.

  I'll volunteer to make the changes and submit a
patch, if it is agreed that the changes should indeed
be made.
msg14620 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2003-02-23 13:48
Logged In: YES 

Excellent.  I hope you'll try to also make a judgement (at
least in some cases) whether a particular piece of demo code
is still relevant -- there is unfortunately a lot of stale
demo code.

Also see if there are other kinds of modernization that
could be done (see PEP 290).
msg14621 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-05-22 07:59
Logged In: YES 

Is this still open or is there a patch forthcoming?
msg63181 - (view) Author: Robert Schuppenies (schuppenies) * (Python committer) Date: 2008-03-02 15:59
The attached patch applies floor division to all classic divisions where
only integer input was used, and true division where at least on input
parameter was of non-integral type. 
In I replaced "int(size/dt)" with "size//dt" as it has the
same semantic but I thought it to be more explicit.
msg73159 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2008-09-13 02:00
Changes to curses/ committed in rev. 66424.

Changes to threading/ committed in rev. 66425.

Changes to Demo/classes/ committed in rev. 66426.

Changes to md5driver/ committed in rev. 66427.

Rest of the changes committed in rev. 66428.

Robert, thank you very much for your patch!
Date User Action Args
2008-09-13 02:00:00akuchlingsetstatus: open -> closed
assignee: akuchling
resolution: accepted
messages: + msg73159
nosy: + akuchling
2008-03-02 15:59:42schuppeniessetfiles: + demo_classicdivision.diff
nosy: + schuppenies
messages: + msg63181
keywords: + patch
2008-01-12 01:02:08akuchlingsetkeywords: + easy
2003-02-16 22:27:52exarkuncreate