Madhusudan Singh wrote:
> I know how to set optional arguments in the function definition. Is there an
> intrinsic function that determines if a certain argument was actually
> passed ? Like the fortran 95 present() logical intrinsic ?
People generally use a value that isn't a valid option, often None.
def my_func(a, b, c=None):
if c is None:
do something
If None is a valid value, make one that isn't:
unspecified = object()
def my_func(a, b, c=unspecified):
if c is unspecified:
do something
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list