MCPcopy Index your code
hub / github.com/RustPython/RustPython / is_file

Method is_file

Lib/pathlib/_os.py:427–439  ·  view source on GitHub ↗

Whether this path is a regular file.

(self, *, follow_symlinks=True)

Source from the content-addressed store, hash-verified

425 return False
426
427 def is_file(self, *, follow_symlinks=True):
428 """Whether this path is a regular file."""
429 if not follow_symlinks and self.is_symlink():
430 return False
431 try:
432 return self._is_file
433 except AttributeError:
434 if os.path.isfile(self._path):
435 self._is_file = self._exists = True
436 return True
437 else:
438 self._is_file = False
439 return False
440
441 def is_symlink(self):
442 """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