Lets say I have an incoming string which is a python function and I would like to convert that to a python signature. I can do that using the importlib function.
For example lets say I have an incoming string "os.getenv" and I want to resolve to the corresponding function signature. I can do something like below.
>>> import importlib
>>> fn = "os.getenv"
>>> package_signature = importlib.import_module("os")
>>> getattr(package_signature, "getenv")
How can I parse and return functions when the functions are lambda functions. For example something like fn = "lambda x: 'a' + x"