2 ms·
In the cases where I need to do this, I use a singleton: DEFAULT=object() # used for no other purpose def fun(arg=DEFAULT): arg_val = {} if arg is D
by sirtaj 10y ago
In the cases where I need to do this, I use a singleton:
DEFAULT=object() # used for no other purpose
def fun(arg=DEFAULT):
arg_val = {} if arg is DEFAULT else arg