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
What about flipping it over?
flag1, flag2, flag3, flag4, flag5, flag6 = range(6)
def func(enable=[], disable=[],
enabled_by_default=[flag5, flag6]):
enabled = set(enabled_by_default + enabled) - set(disabled)
if flag1 in enabled:
...
if flag2 in enabled:
...
func(enable = [flag1, flag2, flag3],
disable = [flag6])