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

Method is_file

Lib/test/test_pathlib/support/local_path.py:122–128  ·  view source on GitHub ↗

Whether this path is a regular file.

(self, *, follow_symlinks=True)

Source from the content-addressed store, hash-verified

120 return self._is_dir
121
122 def is_file(self, *, follow_symlinks=True):
123 """Whether this path is a regular file."""
124 if not follow_symlinks and self.is_symlink():
125 return False
126 if self._is_file is None:
127 self._is_file = os.path.isfile(self._path)
128 return self._is_file
129
130 def is_symlink(self):
131 """Whether this path is a symbolic link."""

Callers

nothing calls this directly

Calls 2

is_symlinkMethod · 0.95
isfileMethod · 0.45

Tested by

no test coverage detected