]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-39285: Clarify example for PurePath.match (GH-19458)
authorTim Lo <timlo@users.noreply.github.com>
Sun, 19 Apr 2020 09:43:11 +0000 (05:43 -0400)
committerGitHub <noreply@github.com>
Sun, 19 Apr 2020 09:43:11 +0000 (02:43 -0700)
Fixes Issue39285

The example incorrectly returned True for match.

Furthermore the example is ambiguous in its usage of PureWindowsPath.
Windows is case-insensitve, however the underlying match functionality
utilizes fnmatch.fnmatchcase.

Automerge-Triggered-By: @pitrou
Doc/library/pathlib.rst

index 004c156e118852cbe5eb90c3de09851dbebc7b4e..d4329e7a4c64a7b2b259ab51191b14391fa81dea 100644 (file)
@@ -528,8 +528,10 @@ Pure paths provide the following methods and properties:
       >>> PurePath('a/b.py').match('/*.py')
       False
 
-   As with other methods, case-sensitivity is observed::
+   As with other methods, case-sensitivity follows platform defaults::
 
+      >>> PurePosixPath('b.py').match('*.PY')
+      False
       >>> PureWindowsPath('b.py').match('*.PY')
       True