summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-03-10 12:20:34 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-03-10 12:20:34 (GMT)
commit524a5ba111e3705c48f2f8fc22f9f0b4b122cae0 (patch)
tree5b266eeb7212252f4fa362f6adce0f4aded2a219 /Doc
parent283f3f8ab326bfd43f9c7c7859ae9815a7545b64 (diff)
downloadcpython-524a5ba111e3705c48f2f8fc22f9f0b4b122cae0.zip
cpython-524a5ba111e3705c48f2f8fc22f9f0b4b122cae0.tar.gz
cpython-524a5ba111e3705c48f2f8fc22f9f0b4b122cae0.tar.bz2
Issue #23605: os.walk() now calls os.scandir() instead of os.listdir().
The usage of os.scandir() reduces the number of calls to os.stat(). Initial patch written by Ben Hoyt.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/os.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 0014b6c..f423f76 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -2618,6 +2618,11 @@ features:
for name in dirs:
os.rmdir(os.path.join(root, name))
+ .. versionchanged:: 3.5
+ The function now calls :func:`os.scandir` instead of :func:`os.listdir`.
+ The usage of :func:`os.scandir` reduces the number of calls to
+ :func:`os.stat`.
+
.. function:: fwalk(top='.', topdown=True, onerror=None, *, follow_symlinks=False, dir_fd=None)