diff options
author | andrei kulakov <andrei.avk@gmail.com> | 2021-12-18 14:23:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-18 14:23:34 (GMT) |
commit | ae36cd1e792db9d6db4c6847ec2a7d50a71f2b68 (patch) | |
tree | 3e223cb1c046e119dbce83550d7bf5a6ed213a76 /Doc | |
parent | 6f2df4295123f8b961d49474b7668f7564a534a4 (diff) | |
download | cpython-ae36cd1e792db9d6db4c6847ec2a7d50a71f2b68.zip cpython-ae36cd1e792db9d6db4c6847ec2a7d50a71f2b68.tar.gz cpython-ae36cd1e792db9d6db4c6847ec2a7d50a71f2b68.tar.bz2 |
bpo-37578: glob.glob -- added include_hidden parameter (GH-30153)
Automerge-Triggered-By: GH:asvetlov
Diffstat (limited to 'Doc')
-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) |