I have a function func(a=1, b=2, c=3)
. Different things happen if all arguments are left as default and if any given two are user-specified, even if the user coincidentally specifies values to be default. Eg:
- User enters
func()
-> thing 1 happens - User enters
func(a=42, c=191)
-> thing 2 happens - User enters
func(a=1, c=3)
-> thing 2 also happens (even though user-specified values happen to be default).
So in order to decide whether to proceed to thing 1 or thing 2, I can't just compare argument values to default. I need to find out which arguments are user-specified, regardless of their values.
(I've also considered making the defaults values nonsense, like NaN or Inf, then checking which values were user-specified by comparing them to NaN or Inf, and then defining them as a=1, b=2, c=3
if need be. That doesn't work because numpy is not imported and doesn't otherwise need to be, so I don't have access to NaN or Inf. But maybe I'm missing something?)
So: is there a way to find out which parameters were user-specified and/or which were left as default, regardless of their actual value?