Is it possible to explicitly tell a function in python to use the default value of a parameter ?
For instance, if a function is defined as:
def foo(a=1, b=2, c=3):
pass
I would like to call the function like:
foo(a=3, b=<USE-DEFAULT>, c=10)
^
|
which should be equivalent to:
foo(a=3, c=10)
One usage example is if a function is used to instantiate an instance of a class:
class foo():
def __init__(a=1, b=2, c=3):
self.a = a
self.b = b
self.c = c
def create_foo(a=None, b=None, c=None):
f = foo( <PASS ALL EXCEPT NONE> )
F = create_foo(a=10, c=30)
# Then F should have a=10, b=2, c=30
In this example, I would like to avoid defining default values multiple times.