@@ -1852,6 +1852,8 @@ features:
1852
1852
Return a list containing the names of the entries in the directory given by
1853
1853
*path *. The list is in arbitrary order, and does not include the special
1854
1854
entries ``'.' `` and ``'..' `` even if they are present in the directory.
1855
+ If a file is removed from or added to the directory during the call of
1856
+ this function, whether a name for that file be included is unspecified.
1855
1857
1856
1858
*path * may be a :term: `path-like object `. If *path * is of type ``bytes ``
1857
1859
(directly or indirectly through the :class: `PathLike ` interface),
@@ -2257,7 +2259,9 @@ features:
2257
2259
Return an iterator of :class: `os.DirEntry ` objects corresponding to the
2258
2260
entries in the directory given by *path *. The entries are yielded in
2259
2261
arbitrary order, and the special entries ``'.' `` and ``'..' `` are not
2260
- included.
2262
+ included. If a file is removed from or added to the directory after
2263
+ creating the iterator, whether an entry for that file be included is
2264
+ unspecified.
2261
2265
2262
2266
Using :func: `scandir ` instead of :func: `listdir ` can significantly
2263
2267
increase the performance of code that also needs file type or file
@@ -3007,7 +3011,10 @@ features:
3007
3011
*filenames * is a list of the names of the non-directory files in *dirpath *.
3008
3012
Note that the names in the lists contain no path components. To get a full path
3009
3013
(which begins with *top *) to a file or directory in *dirpath *, do
3010
- ``os.path.join(dirpath, name) ``.
3014
+ ``os.path.join(dirpath, name) ``. Whether or not the lists are sorted
3015
+ depends on the file system. If a file is removed from or added to the
3016
+ *dirpath * directory during generating the lists, whether a name for that
3017
+ file be included is unspecified.
3011
3018
3012
3019
If optional argument *topdown * is ``True `` or not specified, the triple for a
3013
3020
directory is generated before the triples for any of its subdirectories
0 commit comments