Testing for presence of arguments

Peter Decker pydecker at gmail.com
Wed Aug 17 17:34:22 CEST 2005

On 8/17/05, Madhusudan Singh <spammers-go-here at spam.invalid> 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 ?
> My required functionality depends on whether a certain argument is specified
> at all. (Setting default values is *not* good enough.).

Could you just write the function as:

myFunc(*args, **kwargs):

...and then figure out what was passed?


# p.d.

More information about the Python-list mailing list