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

Method is_file

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

Source from the content-addressed store, hash-verified

143 return self.zip_info.filename.endswith('/')
144
145 def is_file(self, follow_symlinks=True):
146 if follow_symlinks and self.is_symlink():
147 return self.resolve().is_file()
148 elif self.zip_info is None:
149 return False
150 elif fmt := S_IFMT(self.zip_info.external_attr >> 16):
151 return S_ISREG(fmt)
152 else:
153 return not self.zip_info.filename.endswith('/')
154
155 def is_symlink(self):
156 if self.zip_info is None:

Calls 5

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