MCPcopy Create free account
hub / github.com/SplootCode/splootcode / get_value_data

Function get_value_data

python/module_loader.py:53–79  ·  view source on GitHub ↗
(name, thing)

Source from the content-addressed store, hash-verified

51
52
53def get_value_data(name, thing):
54 results = {
55 'name': name,
56 'typeName': type(thing).__name__,
57 'typeModule': type(thing).__module__,
58 'isClass': isclass(thing),
59 'isCallable': callable(thing),
60 'isModule': ismodule(thing),
61 'doc': thing.__doc__,
62 'shortDoc': short_doc(thing.__doc__),
63 }
64
65 if callable(thing):
66 params = None
67 try:
68 if isclass(thing):
69 params = get_method_params(thing.__init__)
70 else:
71 params = get_func_params(thing)
72 except ValueError:
73 # print('No Signature for ', str(thing))
74 pass
75
76 if params is not None:
77 results['parameters'] = params
78
79 return results
80
81def get_type_data(typething, overrides):
82 if len(overrides) != 0:

Callers 2

generate_builtins_docsFunction · 0.90
generate_module_infoFunction · 0.85

Calls 3

short_docFunction · 0.85
get_method_paramsFunction · 0.85
get_func_paramsFunction · 0.85

Tested by

no test coverage detected