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

Function dir_of_mod_or_error

scripts/whats_left.py:269–278  ·  view source on GitHub ↗
(module_name, keep_other=True)

Source from the content-addressed store, hash-verified

267
268
269def dir_of_mod_or_error(module_name, keep_other=True):
270 module = import_module(module_name)
271 item_names = sorted(set(dir(module)))
272 result = {}
273 for item_name in item_names:
274 item = getattr(module, item_name)
275 # don't repeat items imported from other modules
276 if keep_other or is_child(module, item) or inspect.getmodule(item) is None:
277 result[item_name] = extra_info(item)
278 return result
279
280
281def gen_modules():

Callers 2

gen_modulesFunction · 0.85
compareFunction · 0.85

Calls 7

sortedFunction · 0.85
setFunction · 0.85
dirFunction · 0.85
getattrFunction · 0.85
is_childFunction · 0.85
extra_infoFunction · 0.85
import_moduleFunction · 0.70

Tested by

no test coverage detected