https://github.com/python/cpython/commit/72eea512b88f8fd68b7258242c37da963ad87360
commit: 72eea512b88f8fd68b7258242c37da963ad87360
branch: main
author: Barney Gale <[email protected]>
committer: barneygale <[email protected]>
date: 2024-03-22T19:14:09Z
summary:
GH-106747: Document another difference between `glob` and `pathlib`. (#116518)
Document that `path.glob()` might return *path*, whereas
`glob.glob(root_dir=path)` will never return an empty string corresponding
to *path*.
files:
M Doc/library/pathlib.rst
diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst
index 3ff2631d73c0b2..4fba3622b073a7 100644
--- a/Doc/library/pathlib.rst
+++ b/Doc/library/pathlib.rst
@@ -1682,6 +1682,10 @@ The patterns accepted and results generated by
:meth:`Path.glob` and
5. The values returned from pathlib's ``path.glob()`` and ``path.rglob()``
include the *path* as a prefix, unlike the results of
``glob.glob(root_dir=path)``.
+6. The values returned from pathlib's ``path.glob()`` and ``path.rglob()``
+ may include *path* itself, for example when globbing "``**``", whereas the
+ results of ``glob.glob(root_dir=path)`` never include an empty string that
+ would correspond to *path*.
Comparison to the :mod:`os` and :mod:`os.path` modules
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]