I’m looking for something that works like Lisp’s arg-supplied-p variables, to help differentiate a default value from the same value specified by a user.
Example:
def foo(a=10):
pass
I’d like to know in foo if it was called like this:
foo()
or like this:
foo(10)
or even like this:
foo(a=10)
The last 2 are synonymous enough to me; I don’t need to know that detail. I’ve looked through the inspect module a bit, but getargspec returns exactly the same results for all 3 calls.
Except for inspecting the source code, there is no way to tell the three function calls apart – they are meant to have exactly the same meaning. If you need to differentiate between them, use a different default value, e.g.
None.