FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.13] gh-148765: Fix description of *include_hidden* parameter in `glob.glob()` docs (GH-148768) by miss-islington · Pull Request #153172 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) .rst  (1) No extension  (1) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
7 changes: 4 additions & 3 deletions Doc/library/glob.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ not by actually invoking a subshell.
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
Expand Down Expand Up @@ -70,7 +70,8 @@ The :mod:`!glob` module defines the following functions:
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
Expand Down Expand Up @@ -131,7 +132,7 @@ The :mod:`!glob` module defines the following functions:
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
Expand Down
8 changes: 4 additions & 4 deletions Lib/glob.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def glob(pathname, *, root_dir=None, dir_fd=None, recursive=False,
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.
Expand Down Expand Up @@ -64,8 +64,8 @@ def iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False,
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.
Expand Down
1 change: 1 addition & 0 deletions Misc/ACKS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1703,6 +1703,7 @@ Ha Shao
Richard Shapiro
Soumya Sharma
Varun Sharma
Eoin Shaughnessy
Daniel Shaulov
Vlad Shcherbina
Justin Sheehy
Expand Down

Back | FazBrowse Home | New Git URL