infering the number of args a function takes at runtime

Chris Rebert clp at
Mon Dec 8 05:45:19 CET 2008

On Sun, Dec 7, 2008 at 8:39 PM, sniffer <adi at> 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

You want inspect.getargspec() or one of its friends in the `inspect`
module. See


Follow the path of the Iguana...
I really should get back to studying now

> --

More information about the Python-list mailing list