Future division patch available (PEP 238)

Bengt Richter bokr at accessone.com
Mon Aug 13 16:22:27 EDT 2001


On Mon, 13 Aug 2001 10:19:25 -0500, Skip Montanaro <skip at pobox.com> wrote:

>
>    Ian> Clearly there'll be an effective tool to identify likely areas of
>    Ian> concern, but I hope it won't generate too many false-positives (if
>    Ian> that's the correct way round) and zero of whatever the opposite is.
>
>I posted this once.  Maybe once again will be sufficient... ;-)
>
Except on NT4 globbing isn't the default unless you have setargv.obj linked
into your executable (python in this case), so, ignoring indentation changes (-b)
here's a patch for NT to run with 2.1:

[13:18] C:\pywk\tok>diff -u -b finddiv.py.orig finddiv.py
--- finddiv.py.orig     Mon Aug 13 12:43:29 2001
+++ finddiv.py  Mon Aug 13 13:11:36 2001
@@ -1,5 +1,6 @@
 import tokenize
 import sys
+import glob

 class TokenSorter:
     def __init__(self, f):
@@ -21,7 +22,8 @@
             self.lastprinted = self.linenumber

 def main():
-    for fn in sys.argv[1:]:
+    for arg in sys.argv[1:]:
+        for fn in glob.glob(arg):
         try:
             f = open(fn)
         except IOError:

add the '+' lines and subtract the '-' lines, and adjust the
indent for the extra loop nest, and it should work.
(Non-'+/-' lines are just to show context)



More information about the Python-list mailing list