[IronPython] Function Signatures - inspect.getargspec

Anthony Baxter anthonybaxter at gmail.com
Mon Dec 25 08:55:14 CET 2006


On 12/25/06, Michael Foord <fuzzyman at voidspace.org.uk> wrote:
> Hello all,
>
> I'm trying to determine function signatures from IronPython.
>
> In Python I'd use 'inspect.getargspec'.
>
> In IronPython this raises a 'NotImplementedError'.

'inspect' is a pure-python module. Where's the NotImplementedError from?

Hm. A bit of poking around.

def foo(a,b,*c): pass

foo.func_code.co_code is unimplemented - inspect does some foul
disassembly of this for anonymous tuple arguments. I doubt that's ever
going to work, but otherwise it's OK. Except for the bugs.

In CPython:
>>> def foo(a,b,*c):
...     pass
...
>>> foo.func_code.co_argcount
2

While in IronPython...
>>> def foo(a,b,*c):
...     pass
...
>>> foo.func_code.co_argcount
3



More information about the Ironpython-users mailing list