So let's say I have a function which takes two params, but at least one of them should be present:
def foo_bar(foo = None, bar = None):
The problem is that both of them are optional, but in practice either foo
or bar
will be passed in.
Right now I check for existence in the function like this:
do_this() if foo else do_that() sort of logic..
But I don't like the way this looks.
What's the best way to deal with this?