This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients amaury.forgeotdarc, legerf, vstinner
Date 2008-12-09.12:19:37
SpamBayes Score 4.2317197e-06
Marked as misclassified No
Message-id <1228825178.82.0.627833485637.issue4601@psf.upfronthosting.co.za>
In-reply-to
Content
Hum, there is not fixer for 2to3. But I might be hard to write such 
fixer because walk() generates (dirpath, dirnames, filenames) instead 
of (dirpath, filenames).

Python2 prototype:
  os.path.walk(path, visit, arg) -> None
  with visit: callback(arg, dirpath, filenames)

Python3 prototype:
  os.walk(top[, topdown=True[, onerror=None[, followlinks=False]]]) -> 
generator
  with onerror: callback()
  the generator produces (dirpath, dirnames, filenames)

Example:
   os.path.walk('Lib/xml/', callback, 42)
can be replaced by
   for dirpath, dirnames, filenames in os.walk('Lib/xml/'):
      callback(42, dirpath, dirnames + filenames)

About the keyword only: +1 (or +2 :-)).

Index: Lib/os.py
===================================================================
--- Lib/os.py   (révision 67652)
+++ Lib/os.py   (copie de travail)
@@ -192,7 +192,7 @@

 __all__.extend(["makedirs", "removedirs", "renames"])

-def walk(top, topdown=True, onerror=None, followlinks=False):
+def walk(top, *, topdown=True, onerror=None, followlinks=False):
     """Directory tree generator.

     For each directory in the directory tree rooted at top (including 
top
History
Date User Action Args
2008-12-09 12:19:38vstinnersetrecipients: + vstinner, amaury.forgeotdarc, legerf
2008-12-09 12:19:38vstinnersetmessageid: <1228825178.82.0.627833485637.issue4601@psf.upfronthosting.co.za>
2008-12-09 12:19:38vstinnerlinkissue4601 messages
2008-12-09 12:19:37vstinnercreate