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 am missing the good old bitwise flags:
a = 1 b = 2 c = 4 d = 8 def func( data, flags ): print( ( flags & a) == a ) print( ( flags & b) == b ) print( ( flags & c) == c ) print( ( flags & d) == d ) >>>> func("bla", a|c|d) >>>> True >>>> False >>>> True >>>> True