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

Function ispackage

Lib/pydoc.py:314–322  ·  view source on GitHub ↗

Guess whether a path refers to a package directory.

(path)

Source from the content-addressed store, hash-verified

312# ----------------------------------------------------- module manipulation
313
314def ispackage(path):
315 """Guess whether a path refers to a package directory."""
316 warnings.warn('The pydoc.ispackage() function is deprecated',
317 DeprecationWarning, stacklevel=2)
318 if os.path.isdir(path):
319 for ext in ('.py', '.pyc'):
320 if os.path.isfile(os.path.join(path, '__init__' + ext)):
321 return True
322 return False
323
324def source_synopsis(file):
325 """Return the one-line summary of a file object, if present"""

Callers

nothing calls this directly

Calls 4

warnMethod · 0.45
isdirMethod · 0.45
isfileMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…