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

Method is_dir

Lib/test/test_pathlib/support/zip_path.py:135–143  ·  view source on GitHub ↗
(self, follow_symlinks=True)

Source from the content-addressed store, hash-verified

133 return True
134
135 def is_dir(self, follow_symlinks=True):
136 if follow_symlinks and self.is_symlink():
137 return self.resolve().is_dir()
138 elif self.zip_info is None:
139 return True
140 elif fmt := S_IFMT(self.zip_info.external_attr >> 16):
141 return S_ISDIR(fmt)
142 else:
143 return self.zip_info.filename.endswith('/')
144
145 def is_file(self, follow_symlinks=True):
146 if follow_symlinks and self.is_symlink():

Callers 15

test_is_dirMethod · 0.45
test_spec_path_isMethod · 0.45
test_child_path_isMethod · 0.45
test_orphan_path_isMethod · 0.45
test_is_dirMethod · 0.45
test_is_dirMethod · 0.45
test_info_is_dirMethod · 0.45
test_move_dirMethod · 0.45
test_mkdirMethod · 0.45
test_mkdir_parentsMethod · 0.45

Calls 5

is_symlinkMethod · 0.95
resolveMethod · 0.95
S_IFMTFunction · 0.90
S_ISDIRFunction · 0.90
endswithMethod · 0.45

Tested by 15

test_is_dirMethod · 0.36
test_spec_path_isMethod · 0.36
test_child_path_isMethod · 0.36
test_orphan_path_isMethod · 0.36
test_is_dirMethod · 0.36
test_is_dirMethod · 0.36
test_info_is_dirMethod · 0.36
test_move_dirMethod · 0.36
test_mkdirMethod · 0.36
test_mkdir_parentsMethod · 0.36