I would like to retrieve the number of arguments that have been passed to a Python function. In fact I am writting a Matlab code in Python and in Matlab, the code line is :
if (nargin > 2)
...
end
I would like to do the same thing in Python with a function that have this form : def my_func(a,b,c=3,d=4, ...):
When calling it, I would be able to retrieve the number of passed arguments, for instance :
my_func(1,2) would return 2
my_func(1,2,3) would return 3
my_func(1,2,3,4) would return 4 etc.
I have seen some topics but only giving the number of arguments and description of the function, and not the number of arguments passed when calling it in a script.
I hope that I am clear in explaining my issue.
Best regards, MOCHON Rémi