From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 2 May 2022 15:33:39 +0000 (-0700) Subject: gh-88546: glob.glob docs: Make new paragraph for emphasis and reordered sentence... X-Git-Tag: v3.9.13~56 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9b7cdfdf357fa819fd47f0ebe1c0e2010a5d4e31;p=thirdparty%2FPython%2Fcpython.git gh-88546: glob.glob docs: Make new paragraph for emphasis and reordered sentence (GH-91614) (cherry picked from commit b9ab6cea0819bd498063f0934cb5bb0bb5a6a2d4) Co-authored-by: slateny <46876382+slateny@users.noreply.github.com> --- diff --git a/Doc/library/glob.rst b/Doc/library/glob.rst index 3c468ebf7376..ced84c7fd8d1 100644 --- a/Doc/library/glob.rst +++ b/Doc/library/glob.rst @@ -23,8 +23,11 @@ according to the rules used by the Unix shell, although results are returned in arbitrary order. No tilde expansion is done, but ``*``, ``?``, and character ranges expressed with ``[]`` will be correctly matched. This is done by using the :func:`os.scandir` and :func:`fnmatch.fnmatch` functions in concert, and -not by actually invoking a subshell. Note that unlike :func:`fnmatch.fnmatch`, -:mod:`glob` treats filenames beginning with a dot (``.``) as special cases. +not by actually invoking a subshell. + +Note that 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 :func:`os.path.expandvars`.)