mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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.
This commit is contained in:
parent
37d0950022
commit
a40f557d7b
4 changed files with 314 additions and 309 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue