Re: [Tutor] Check Number of Parameters Passed In

2008-07-13 Thread Kent Johnson
On Sun, Jul 13, 2008 at 9:05 PM, bob gailer <[EMAIL PROTECTED]> wrote: > As an alternative to Kent's suggestion consider: > > def foo(parameter, *args) > > args will be a tuple with 0, 1 or more items in it. > > So you can test for len(args) == 1 Presumably the OP wants to distinguish between op1

Re: [Tutor] Check Number of Parameters Passed In

2008-07-13 Thread bob gailer
James wrote: Hi All, I'm writing a function that has optional paramters (i.e., "foo( parameter , optionalParameter = None , optionalParameter2 = None )"). Is there some way inside of foo() that I can check to see how many parameters have been passed in? I want to check to ensure that only *one*

Re: [Tutor] Check Number of Parameters Passed In

2008-07-13 Thread Kent Johnson
On Sun, Jul 13, 2008 at 7:27 PM, James <[EMAIL PROTECTED]> wrote: > Hi All, > > I'm writing a function that has optional paramters (i.e., "foo( > parameter , optionalParameter = None , optionalParameter2 = None )"). > > Is there some way inside of foo() that I can check to see how many > parameters

[Tutor] Check Number of Parameters Passed In

2008-07-13 Thread James
Hi All, I'm writing a function that has optional paramters (i.e., "foo( parameter , optionalParameter = None , optionalParameter2 = None )"). Is there some way inside of foo() that I can check to see how many parameters have been passed in? I want to check to ensure that only *one* optional param