For a long time i have been trying to figure out what is the best way to pass flags to python functions. The most straightforward way is something like:
def func
I prefer functions without flags. Rather do this:
def func_flag1(arg):
pass # something useful
def func_flag2(arg):
pass # something for flag 2.
But "flagX" would actually be something meaningful like "do_X_with_option".
I prefer this because it makes it clearer, you keep the functions simpler (fewer bugs), and you don't have to carry some constants into other modules (in the case of flags actually being some kind of enumeration).