8000 GH-101112: Add "pattern language" section to pathlib docs by barneygale · Pull Request #114030 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-101112: Add "pattern language" section to pathlib docs #114030

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Feb 26, 2024
Prev Previous commit
Next Next commit
Move language change notices into new section.
  • Loading branch information
barneygale committed Jan 30, 2024
commit b60970b34a3468daacf9de96e267b38d9ceab8b9
16 changes: 8 additions & 8 deletions Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1024,20 +1024,12 @@ call fails (for example because the path doesn't exist).

.. audit-event:: pathlib.Path.glob self,pattern pathlib.Path.glob

.. versionchanged:: 3.11
Return only directories if *pattern* ends with a pathname components
separator (:data:`~os.sep` or :data:`~os.altsep`).

.. versionchanged:: 3.12
The *case_sensitive* parameter was added.

.. versionchanged:: 3.13
The *follow_symlinks* parameter was added.

.. versionchanged:: 3.13
Return files and directories if *pattern* ends with "``**``". In
previous versions, only directories were returned.

.. versionchanged:: 3.13
The *pattern* parameter accepts a :term:`path-like object`.

Expand Down Expand Up @@ -1657,6 +1649,10 @@ Pattern Meaning
Globbing with the "``**``" wildcard visits every directory in the tree.
Large directory trees may take a long time to search.

.. versionchanged:: 3.13
Globbing with a pattern that ends with "``**``" returns both files and
directories. In previous versions, only directories were returned.

In :meth:`Path.glob` and :meth:`~Path.rglob`, a trailing slash may be added to
the pattern to match only directories.

Expand All @@ -1665,6 +1661,10 @@ the pattern to match only directories.
:meth:`Path.glob` and :meth:`~Path.rglob` don't include any trailing slash
given in the pattern. :meth:`PurePath.full_match` ignores trailing slashes.

.. versionchanged:: 3.11
Globbing with a pattern that ends with a pathname components separator
(:data:`~os.sep` or :data:`~os.altsep`) returns only directories.


Correspondence to tools in the :mod:`os` module
-----------------------------------------------
Expand Down
0