Howto get the argument defaults of a function using an AST-object?

stefan at mayr-stefan.de stefan at mayr-stefan.de
Tue Jul 4 07:54:28 EDT 2006


Fredrik Lundh schrieb:
> ....
> > def foo(x, y=True)
> > def foo(x=True, y)
>
> the latter is a syntax error.
> ...
>
> the defaults array contains the defaults for the len(defaults) last arguments.

And again the own stupidity: I didn't check all my testcases for syntax
errors.

Thanks a lot,

    Stefan




More information about the Python-list mailing list