We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8897d87 commit 2dce3b6Copy full SHA for 2dce3b6
module_functions_getter.py
@@ -0,0 +1,16 @@
1
+import operator
2
+import inspect
3
+
4
5
+def get_module_functions(module, function_prefix=''):
6
7
+ def filter_function(inspected_function):
8
+ function_name, function = inspected_function
9
+ if (function_name.startswith(function_prefix) and
10
+ inspect.getmodule(function) == module):
11
+ return True
12
13
+ funcs = map(operator.itemgetter(1),
14
+ filter(filter_function,
15
+ inspect.getmembers(module, inspect.isfunction)))
16
+ return funcs
0 commit comments