On Mon, 08 Dec 2008 02:40:03 -0800, sniffer wrote:

> On Dec 8, 9:39 am, sniffer <[EMAIL PROTECTED]> wrote:
>> hi all,
>> i am a python newbie, in a project currently doing i need to find out
>> the number of arguments that a function takes at runtime.? Is this
>> possible ,if so how do i do this,i ve looked through the python
>> documentation but couldnt find anything.any help will be great
>>
>> TIA
> 
> Thanks guys , i think this should work for me.btw as enquired i am
> working o a mvc thingie where in need to call functions in a
> controller,and pass the arguments as recieved from the end user so i
> need to make sure that the number of arguments passed from the front end
> are correct or not in the context of the function being called

In python, usually you'll just pass the them all and maybe catch errors.

def callback(*args, **kargs):
    try:
        return func(*args, **kargs)
    except TypeError:
        print('An error happened')

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to