Sets the value of the parameter. Should not be called directly; use model.param()
instead.
WARNING: This is an internal function. Its use in user code is not recommended or supported, and its signature can change in future updates without warning. Use one of the suggested functions above instead, if applicable.
Parameters
val — str|bool|num, required
The value to set the parameter to. Variable type depends on the parameter type:
str
for a menu, abool
for a checkbox, or anum
for a slider.item — str, optional
If the parameter is a per-good or per-breed parameter, this argument must be set to specifiy which good or breed to set the parameter value for. Otherwise the function raises a
KeyError
.Default value: None
Notes and Examples