You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Modifying the default value of a parameter can lead to unexpected results.
The default value of a parameter is computed once when the function is created, not for every invocation. The "pre-computed" value is then used for every subsequent call to the function. Consequently, if you modify the default value for a parameter this "modified" default value is used for the parameter in future calls to the function. This means that the function may not behave as expected in future calls and also makes the function more difficult to understand.
some_dict.pop() is used in several places in algorithms.py which leads to modification of defaults (ref here and here).
Remark
Is there some reason why pop() is used in place of standard dictionary access routines?
The text was updated successfully, but these errors were encountered:
We pop out the key-value pairs from options that are not used/expected by the SciPy optimizer. We then pass this entire dict to the optimizer so that there are no incompatible keys in the dict.
Describe the bug
Modifying the default value of a parameter can lead to unexpected results.
some_dict.pop()
is used in several places inalgorithms.py
which leads to modification of defaults (ref here and here).Remark
Is there some reason why
pop()
is used in place of standard dictionary access routines?The text was updated successfully, but these errors were encountered: