mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
GH-127381: pathlib ABCs: remove ReadablePath.rglob() (#130207)
Remove `ReadablePath.rglob()` from the private pathlib ABCs. This method is a trivial wrapper around `glob()` and easily replaced.
This commit is contained in:
parent
7fcace99bb
commit
6f07016bf0
3 changed files with 58 additions and 68 deletions
|
|
@ -302,16 +302,6 @@ def glob(self, pattern, *, case_sensitive=None, recurse_symlinks=True):
|
|||
select = globber.selector(parts)
|
||||
return select(self.joinpath(''))
|
||||
|
||||
def rglob(self, pattern, *, case_sensitive=None, recurse_symlinks=True):
|
||||
"""Recursively yield all existing files (of any kind, including
|
||||
directories) matching the given relative pattern, anywhere in
|
||||
this subtree.
|
||||
"""
|
||||
if not isinstance(pattern, JoinablePath):
|
||||
pattern = self.with_segments(pattern)
|
||||
pattern = '**' / pattern
|
||||
return self.glob(pattern, case_sensitive=case_sensitive, recurse_symlinks=recurse_symlinks)
|
||||
|
||||
def walk(self, top_down=True, on_error=None, follow_symlinks=False):
|
||||
"""Walk the directory tree from this directory, similar to os.walk()."""
|
||||
paths = [self]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue