[Python-checkins] CVS: python/dist/src/Lib dospath.py,1.24,1.25 macpath.py,1.30,1.31 ntpath.py,1.42,1.43 posixpath.py,1.45,1.46

Tim Peters tim_one@users.sourceforge.net
Tue, 09 Oct 2001 21:16:22 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv25866/python/Lib

Modified Files:
	dospath.py macpath.py ntpath.py posixpath.py 
Log Message:
SF bug [#469732] os.path.walk docstring inconsistent.
We have 5 implementations of walk(), and 5 different docstrings.  Combined
'em.  Let's see how long it takes before they're all different again!


Index: dospath.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/dospath.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** dospath.py	2001/09/17 15:16:09	1.24
--- dospath.py	2001/10/10 04:16:20	1.25
***************
*** 184,194 ****
  
  def walk(top, func, arg):
!     """Directory tree walk.
!     For each directory under top (including top itself, but excluding
!     '.' and '..'), func(arg, dirname, filenames) is called, where
!     dirname is the name of the directory and filenames is the list
!     files files (and subdirectories etc.) in the directory.
!     The func may modify the filenames list, to implement a filter,
!     or to impose a different order of visiting."""
  
      try:
--- 184,200 ----
  
  def walk(top, func, arg):
!     """Directory tree walk with callback function.
! 
!     For each directory in the directory tree rooted at top (including top
!     itself, but excluding '.' and '..'), call func(arg, dirname, fnames).
!     dirname is the name of the directory, and fnames a list of the names of
!     the files and subdirectories in dirname (excluding '.' and '..').  func
!     may modify the fnames list in-place (e.g. via del or slice assignment),
!     and walk will only recurse into the subdirectories whose names remain in
!     fnames; this can be used to implement a filter, or to impose a specific
!     order of visiting.  No semantics are defined for, or required of, arg,
!     beyond that arg is always passed to func.  It can be used, e.g., to pass
!     a filename pattern, or a mutable object designed to accumulate
!     statistics.  Passing None for arg is common."""
  
      try:

Index: macpath.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/macpath.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** macpath.py	2001/09/17 15:16:09	1.30
--- macpath.py	2001/10/10 04:16:20	1.31
***************
*** 202,212 ****
  
  def walk(top, func, arg):
!     """Directory tree walk.
!     For each directory under top (including top itself),
!     func(arg, dirname, filenames) is called, where
!     dirname is the name of the directory and filenames is the list
!     of files (and subdirectories etc.) in the directory.
!     The func may modify the filenames list, to implement a filter,
!     or to impose a different order of visiting."""
  
      try:
--- 202,218 ----
  
  def walk(top, func, arg):
!     """Directory tree walk with callback function.
! 
!     For each directory in the directory tree rooted at top (including top
!     itself, but excluding '.' and '..'), call func(arg, dirname, fnames).
!     dirname is the name of the directory, and fnames a list of the names of
!     the files and subdirectories in dirname (excluding '.' and '..').  func
!     may modify the fnames list in-place (e.g. via del or slice assignment),
!     and walk will only recurse into the subdirectories whose names remain in
!     fnames; this can be used to implement a filter, or to impose a specific
!     order of visiting.  No semantics are defined for, or required of, arg,
!     beyond that arg is always passed to func.  It can be used, e.g., to pass
!     a filename pattern, or a mutable object designed to accumulate
!     statistics.  Passing None for arg is common."""
  
      try:

Index: ntpath.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/ntpath.py,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** ntpath.py	2001/09/17 15:16:09	1.42
--- ntpath.py	2001/10/10 04:16:20	1.43
***************
*** 292,300 ****
  
  def walk(top, func, arg):
!     """Directory tree walk whth callback function.
  
!     walk(top, func, arg) calls func(arg, d, files) for each directory d
!     in the tree rooted at top (including top itself); files is a list
!     of all the files and subdirs in directory d."""
      try:
          names = os.listdir(top)
--- 292,309 ----
  
  def walk(top, func, arg):
!     """Directory tree walk with callback function.
  
!     For each directory in the directory tree rooted at top (including top
!     itself, but excluding '.' and '..'), call func(arg, dirname, fnames).
!     dirname is the name of the directory, and fnames a list of the names of
!     the files and subdirectories in dirname (excluding '.' and '..').  func
!     may modify the fnames list in-place (e.g. via del or slice assignment),
!     and walk will only recurse into the subdirectories whose names remain in
!     fnames; this can be used to implement a filter, or to impose a specific
!     order of visiting.  No semantics are defined for, or required of, arg,
!     beyond that arg is always passed to func.  It can be used, e.g., to pass
!     a filename pattern, or a mutable object designed to accumulate
!     statistics.  Passing None for arg is common."""
! 
      try:
          names = os.listdir(top)

Index: posixpath.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/posixpath.py,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** posixpath.py	2001/09/18 02:26:39	1.45
--- posixpath.py	2001/10/10 04:16:20	1.46
***************
*** 259,266 ****
  
  def walk(top, func, arg):
!     """walk(top,func,arg) calls func(arg, d, files) for each directory "d"
!     in the tree  rooted at "top" (including "top" itself).  "files" is a list
!     of all the files and subdirs in directory "d".
!     """
      try:
          names = os.listdir(top)
--- 259,276 ----
  
  def walk(top, func, arg):
!     """Directory tree walk with callback function.
! 
!     For each directory in the directory tree rooted at top (including top
!     itself, but excluding '.' and '..'), call func(arg, dirname, fnames).
!     dirname is the name of the directory, and fnames a list of the names of
!     the files and subdirectories in dirname (excluding '.' and '..').  func
!     may modify the fnames list in-place (e.g. via del or slice assignment),
!     and walk will only recurse into the subdirectories whose names remain in
!     fnames; this can be used to implement a filter, or to impose a specific
!     order of visiting.  No semantics are defined for, or required of, arg,
!     beyond that arg is always passed to func.  It can be used, e.g., to pass
!     a filename pattern, or a mutable object designed to accumulate
!     statistics.  Passing None for arg is common."""
! 
      try:
          names = os.listdir(top)