TLDR: I want to pass an argument to a function which forces the function to use it's default, as if I didn't supply any arguments.
For example
def foo(string = "DEFAULT PARAM"):
print(string)
def bar(string = None):
foo(string)
bar() # Should print "DEFAULT PARAM", but instead prints None
bar("Hello!") # Should print "Hello!"
I know there are a lot of workarounds like:
def bar(string = None):
foo() if string is None else foo(string)
But I was hoping for something more elegant. Like some kind of default keyword I can set bar's default string to. Is that a thing?