@@ -1828,6 +1828,8 @@ features:
1828
1828
Return a list containing the names of the entries in the directory given by
1829
1829
*path *. The list is in arbitrary order, and does not include the special
1830
1830
entries ``'.' `` and ``'..' `` even if they are present in the directory.
1831
+ If a file is removed from or added to the directory during the call of
1832
+ this function, whether a name for that file be included is unspecified.
1831
1833
1832
1834
*path * may be a :term: `path-like object `. If *path * is of type ``bytes ``
1833
1835
(directly or indirectly through the :class: `PathLike ` interface),
@@ -2233,7 +2235,9 @@ features:
2233
2235
Return an iterator of :class: `os.DirEntry ` objects corresponding to the
2234
2236
entries in the directory given by *path *. The entries are yielded in
2235
2237
arbitrary order, and the special entries ``'.' `` and ``'..' `` are not
2236
- included.
2238
+ included. If a file is removed from or added to the directory after
2239
+ creating the iterator, whether an entry for that file be included is
2240
+ unspecified.
2237
2241
2238
2242
Using :func: `scandir ` instead of :func: `listdir ` can significantly
2239
2243
increase the performance of code that also needs file type or file
@@ -2983,7 +2987,10 @@ features:
2983
2987
*filenames * is a list of the names of the non-directory files in *dirpath *.
2984
2988
Note that the names in the lists contain no path components. To get a full path
2985
2989
(which begins with *top *) to a file or directory in *dirpath *, do
2986
- ``os.path.join(dirpath, name) ``.
2990
+ ``os.path.join(dirpath, name) ``. Whether or not the lists are sorted
2991
+ depends on the file system. If a file is removed from or added to the
2992
+ *dirpath * directory during generating the lists, whether a name for that
2993
+ file be included is unspecified.
2987
2994
2988
2995
If optional argument *topdown * is ``True `` or not specified, the triple for a
2989
2996
directory is generated before the triples for any of its subdirectories
0 commit comments