mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
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*.
This commit is contained in:
parent
e28477f214
commit
72eea512b8
1 changed files with 4 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue