I am trying to understand the following syntax. Why is it allowed to pass in arguments that are less than the given outcome? For example,
def fit_curve_custom(f, xdata, ydata, p0=None, sigma=None, **kwargs):
po, pc = curve_fit(f, xdata, ydata, p0, sigma, **kwargs)
def fit(x, a, b, c):
return a*exp(b)+c
(po, pun, rac, de) = fit_curve_custom(fit, xsamples, yobserved)
In the above code fit_curve_custom
has six arguments however when it is called later there are only three arguments passed and yet it still behaves as expected? Does this syntax actually have a name? Also, the function fit
has four parameters and yet when it is called in fit_curve_custom
no parameters are passed? Why is that possible?