@@ -1837,6 +1837,8 @@ features:
1837
1837
Return a list containing the names of the entries in the directory given by
1838
1838
*path *. The list is in arbitrary order, and does not include the special
1839
1839
entries ``'.' `` and ``'..' `` even if they are present in the directory.
1840
+ If a file is removed from or added to the directory during the call of
1841
+ this function, whether a name for that file be included is unspecified.
1840
1842
1841
1843
*path * may be a :term: `path-like object `. If *path * is of type ``bytes ``
1842
1844
(directly or indirectly through the :class: `PathLike ` interface),
@@ -2242,7 +2244,9 @@ features:
2242
2244
Return an iterator of :class: `os.DirEntry ` objects corresponding to the
2243
2245
entries in the directory given by *path *. The entries are yielded in
2244
2246
arbitrary order, and the special entries ``'.' `` and ``'..' `` are not
2245
- included.
2247
+ included. If a file is removed from or added to the directory after
2248
+ creating the iterator, whether an entry for that file be included is
2249
+ unspecified.
2246
2250
2247
2251
Using :func: `scandir ` instead of :func: `listdir ` can significantly
2248
2252
increase the performance of code that also needs file type or file
@@ -2992,7 +2996,10 @@ features:
2992
2996
*filenames * is a list of the names of the non-directory files in *dirpath *.
2993
2997
Note that the names in the lists contain no path components. To get a full path
2994
2998
(which begins with *top *) to a file or directory in *dirpath *, do
2995
- ``os.path.join(dirpath, name) ``.
2999
+ ``os.path.join(dirpath, name) ``. Whether or not the lists are sorted
3000
+ depends on the file system. If a file is removed from or added to the
3001
+ *dirpath * directory during generating the lists, whether a name for that
3002
+ file be included is unspecified.
2996
3003
2997
3004
If optional argument *topdown * is ``True `` or not specified, the triple for a
2998
3005
directory is generated before the triples for any of its subdirectories
0 commit comments