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

Method ispackagedir

Lib/idlelib/pathbrowser.py:75–80  ·  view source on GitHub ↗

Return true for directories that are packages.

(self, file)

Source from the content-addressed store, hash-verified

73 return sublist
74
75 def ispackagedir(self, file):
76 " Return true for directories that are packages."
77 if not os.path.isdir(file):
78 return False
79 init = os.path.join(file, "__init__.py")
80 return os.path.exists(init)
81
82 def listmodules(self, allnames):
83 modules = {}

Callers 2

GetSubListMethod · 0.95

Calls 3

isdirMethod · 0.45
joinMethod · 0.45
existsMethod · 0.45

Tested by 1