I\'m trying to simplify one of my homework problems and make the code a little better. What I\'m working with is a binary search tree. Right now I have a function in my
If you want to treat None
as a valid argument, you could use a **kwarg
parameter.
def function(arg1, arg2, **kwargs):
kwargs.setdefault('arg3', default)
arg3 = kwargs['arg3']
# Continue with function
function("amazing", "fantastic") # uses default
function("foo", "bar", arg3=None) # Not default, but None
function("hello", "world", arg3="!!!")