MCPcopy Index your code
hub / github.com/python/cpython / walk

Method walk

Lib/pathlib/__init__.py:1080–1090  ·  view source on GitHub ↗

Walk the directory tree from this directory, similar to os.walk().

(self, top_down=True, on_error=None, follow_symlinks=False)

Source from the content-addressed store, hash-verified

1078 return self.glob(pattern, case_sensitive=case_sensitive, recurse_symlinks=recurse_symlinks)
1079
1080 def walk(self, top_down=True, on_error=None, follow_symlinks=False):
1081 """Walk the directory tree from this directory, similar to os.walk()."""
1082 sys.audit("pathlib.Path.walk", self, on_error, follow_symlinks)
1083 root_dir = str(self)
1084 if not follow_symlinks:
1085 follow_symlinks = os._walk_symlinks_as_files
1086 results = os.walk(root_dir, top_down, on_error, follow_symlinks)
1087 for path_str, dirnames, filenames in results:
1088 if root_dir == '.':
1089 path_str = path_str[2:]
1090 yield self._from_parsed_string(path_str), dirnames, filenames
1091
1092 def absolute(self):
1093 """Return an absolute version of this path

Callers 15

mainFunction · 0.45
deltreeFunction · 0.45
_rmtree_unsafeFunction · 0.45
_make_zipfileFunction · 0.45
remove_folderMethod · 0.45
walkFunction · 0.45
body_line_iteratorFunction · 0.45
typed_subpart_iteratorFunction · 0.45
get_charsetsMethod · 0.45
_dispatchMethod · 0.45
findfilesFunction · 0.45
available_timezonesFunction · 0.45

Calls 2

strFunction · 0.85
_from_parsed_stringMethod · 0.80

Tested by 1

recompile_pymodsMethod · 0.36