Get actual call signature?

Terry Reedy tjreedy at udel.edu
Tue Mar 18 22:06:27 EDT 2008


"Jarek Zgoda" <jzgoda at o2.usun.pl> wrote in message 
news:fro6j9$i44$1 at nemesis.news.neostrada.pl...
| Say, I have a function defined as:
|
| def fun(arg_one, arg_two='x', arg_three=None):
|    pass
|
| Is there any way to get actual arguments that will be effectively used
| when I call this function in various ways, like:
...

| I'd like to wrap function definition with a decorator that intercepts
| not only passed arguments, but also defaults that will be actually used
| in execution.

You essentially have to do the same thing the interpreter does to call a 
function, which, as has been noted, is pretty hairy.  You just want to 
print the args instead of executing the code. 






More information about the Python-list mailing list