Let's say I have a method with a few optional parameters.
def foo(a, b=1, c=2, d=3)
How do I go about calling it so that if my variables are None or empty strings the defaults are used?
Conditionals like the following seems like a horrible solution:
if b and not c and d:
foo(myA, b = myB, d = myD)
elif b and not c and not d:
...
In Java I'd jump for a factory, but it seems like that's what defaults are supposed to avoid in this case.