[Python-checkins] bpo-39285: Clarify example for PurePath.match (GH-19458)

Tim Lo webhook-mailer at python.org
Sun Apr 19 05:43:15 EDT 2020


https://github.com/python/cpython/commit/c12375aa0b838d34067efa3f1b9a1fbc632d0413
commit: c12375aa0b838d34067efa3f1b9a1fbc632d0413
branch: master
author: Tim Lo <timlo at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-04-19T02:43:11-07:00
summary:

bpo-39285: Clarify example for PurePath.match (GH-19458)



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

files:
M Doc/library/pathlib.rst

diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst
index 004c156e11885..d4329e7a4c64a 100644
--- a/Doc/library/pathlib.rst
+++ b/Doc/library/pathlib.rst
@@ -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
 



More information about the Python-checkins mailing list