inspect, , , , . inspect.getmembers : , , (, bool), (return True for) , .
", ", :
import sys
this_module = sys.modules[__name__]
, , , site_:
import inspect
def function_that_has_site(f):
return inspect.isfunction(f) and f.__name__.startswith('site_')
:
for n, coolfunc in inspect.getmembers(this_module, function_that_has_site):
result = coolfunc(blabla, yada)
if result: return result
, ( , , )... Python; -)