using inspect on pygtk

BJörn Lindqvist bjourne at
Mon Oct 1 18:53:50 CEST 2007

On 9/29/07, Chris Pax <christopher.pax at> wrote:
> Hello,
> I recently been trying to use the inspect module to inspect the
> arguments of gtk objects, such as gtk.Button. I tried like this:
> inspect.getargspec(gtk.Button.__init__)
> and get the fallowing error:
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib/python2.5/", line 743, in getargspec
>     raise TypeError('arg is not a Python function')
> TypeError: arg is not a Python function

What you are seeing is completely normal. inspect.getargspec(sys.exit)
gives the same result. PyGTK is a wrapper around the GTK+ C library
and since all the code is written in C, inspect can't infer anything
about the function gtk.Button.__init__.

mvh Björn

More information about the Python-list mailing list