The pathnames are returned in no particular order. If you need a specific
order, sort the results.
-Files beginning with a dot (``.``) can only be matched by
+By default, files beginning with a dot (``.``) can only be matched by
patterns that also start with a dot,
unlike :func:`fnmatch.fnmatch` or :func:`pathlib.Path.glob`.
For tilde and shell variable expansion, use :func:`os.path.expanduser` and
pattern is followed by an :data:`os.sep` or :data:`os.altsep` then files will not
match.
- If *include_hidden* is true, "``**``" pattern will match hidden directories.
+ If *include_hidden* is true, wildcards can match path segments that
+ begin with a dot (``.``).
.. audit-event:: glob.glob pathname,recursive glob.glob
.. audit-event:: glob.glob/2 pathname,recursive,root_dir,dir_fd glob.glob
Escape all special characters (``'?'``, ``'*'`` and ``'['``).
This is useful if you want to match an arbitrary literal string that may
have special characters in it. Special characters in drive/UNC
- sharepoints are not escaped, e.g. on Windows
+ sharepoints are not escaped, for example on Windows
``escape('//?/c:/Quo vadis?.txt')`` returns ``'//?/c:/Quo vadis[?].txt'``.
.. versionadded:: 3.4
If `dir_fd` is not None, it should be a file descriptor referring to a
directory, and paths will then be relative to that directory.
- If `include_hidden` is true, the patterns '*', '?', '**' will match
- hidden directories.
+ If `include_hidden` is true, wildcards can match path segments beginning
+ with a dot ('.').
If `recursive` is true, the pattern '**' will match any files and
zero or more directories and subdirectories.
If `dir_fd` is not None, it should be a file descriptor referring to a
directory, and paths will then be relative to that directory.
- If `include_hidden` is true, the patterns '*', '?', '**' will match
- hidden directories.
+ If `include_hidden` is true, wildcards can match path segments beginning
+ with a dot ('.').
If `recursive` is true, the pattern '**' will match any files and
zero or more directories and subdirectories.