diff options
Diffstat (limited to 'Doc/library/glob.rst')
-rw-r--r-- | Doc/library/glob.rst | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Doc/library/glob.rst b/Doc/library/glob.rst index 215f60d..54621d1 100644 --- a/Doc/library/glob.rst +++ b/Doc/library/glob.rst @@ -36,7 +36,8 @@ For example, ``'[?]'`` matches the character ``'?'``. The :mod:`pathlib` module offers high-level path objects. -.. function:: glob(pathname, *, root_dir=None, dir_fd=None, recursive=False) +.. function:: glob(pathname, *, root_dir=None, dir_fd=None, recursive=False, \ + include_hidden=False) Return a possibly-empty list of path names that match *pathname*, which must be a string containing a path specification. *pathname* can be either absolute @@ -64,6 +65,8 @@ For example, ``'[?]'`` matches the character ``'?'``. 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. + .. audit-event:: glob.glob pathname,recursive glob.glob .. audit-event:: glob.glob/2 pathname,recursive,root_dir,dir_fd glob.glob @@ -77,8 +80,12 @@ For example, ``'[?]'`` matches the character ``'?'``. .. versionchanged:: 3.10 Added the *root_dir* and *dir_fd* parameters. + .. versionchanged:: 3.11 + Added the *include_hidden* parameter. + -.. function:: iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False) +.. function:: iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False, \ + include_hidden=False) Return an :term:`iterator` which yields the same values as :func:`glob` without actually storing them all simultaneously. @@ -92,6 +99,9 @@ For example, ``'[?]'`` matches the character ``'?'``. .. versionchanged:: 3.10 Added the *root_dir* and *dir_fd* parameters. + .. versionchanged:: 3.11 + Added the *include_hidden* parameter. + .. function:: escape(pathname) |