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

Function ispackage

Lib/pydoc.py:379–387  ·  view source on GitHub ↗

Guess whether a path refers to a package directory.

(path)

Source from the content-addressed store, hash-verified

377# ----------------------------------------------------- module manipulation
378
379def ispackage(path):
380 """Guess whether a path refers to a package directory."""
381 warnings.warn('The pydoc.ispackage() function is deprecated',
382 DeprecationWarning, stacklevel=2)
383 if os.path.isdir(path):
384 for ext in ('.py', '.pyc'):
385 if os.path.isfile(os.path.join(path, '__init__' + ext)):
386 return True
387 return False
388
389def source_synopsis(file):
390 """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