Writing a cli function that should do the following:
In case, the function parameters are not set (I get them from docopt), I would like to look them up from environment. The following does not work due to fast loading in functions:
def my_function(a=None, b=None, c=None):
for v in ("a", "b", "c"):
if vars()[v] is None:
locals()[v] = getenv("env_{}".format(v).upper())
do_something_with(a, b, c)
What would be the pythonic way to achieve this?