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

Function isfile

Lib/genericpath.py:37–43  ·  view source on GitHub ↗

Test whether a path is a regular file

(path)

Source from the content-addressed store, hash-verified

35# This follows symbolic links, so both islink() and isdir() can be true
36# for the same path on systems that support symlinks
37def isfile(path):
38 """Test whether a path is a regular file"""
39 try:
40 st = os.stat(path)
41 except (OSError, ValueError):
42 return False
43 return stat.S_ISREG(st.st_mode)
44
45
46# Is a path a directory?

Callers 4

readconfigFunction · 0.90
show_idlehelpFunction · 0.90
getpath.pyFile · 0.85

Calls 1

statMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…