diff options
author | Barney Gale <barney.gale@gmail.com> | 2024-05-03 20:29:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-03 20:29:25 (GMT) |
commit | a40f557d7b7a355a55bb90c068e3e9202fd9c8f2 (patch) | |
tree | e61989ef41abe7d9eb6b693bbd7300f308b16396 /Lib/pathlib/__init__.py | |
parent | 37d095002216a4e45b4e82539ca0421ded8aaae3 (diff) | |
download | cpython-a40f557d7b7a355a55bb90c068e3e9202fd9c8f2.zip cpython-a40f557d7b7a355a55bb90c068e3e9202fd9c8f2.tar.gz cpython-a40f557d7b7a355a55bb90c068e3e9202fd9c8f2.tar.bz2 |
GH-116380: Move pathlib globbing implementation into `pathlib._glob` (#118562)
Moving this code under the `pathlib` package makes it quite a lot easier
to backport in the `pathlib-abc` PyPI package. It was a bit foolish of me
to add it to `glob` in the first place.
Also add `translate()` to `__all__` in `glob`. This function is new in
3.13, so there's no NEWS needed.
Diffstat (limited to 'Lib/pathlib/__init__.py')
-rw-r--r-- | Lib/pathlib/__init__.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/pathlib/__init__.py b/Lib/pathlib/__init__.py index 8eecf2c..381b08c 100644 --- a/Lib/pathlib/__init__.py +++ b/Lib/pathlib/__init__.py @@ -5,7 +5,6 @@ paths with operations that have semantics appropriate for different operating systems. """ -import glob import io import ntpath import operator @@ -25,7 +24,7 @@ try: except ImportError: grp = None -from . import _abc +from . import _abc, _glob __all__ = [ @@ -113,7 +112,7 @@ class PurePath(_abc.PurePathBase): '_hash', ) parser = os.path - _globber = glob._Globber + _globber = _glob.Globber def __new__(cls, *args, **kwargs): """Construct a PurePath from one or several strings and or existing |