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
For the most part I did an okay job of using None as the default argument value and then setting the mutable value in __init__; but there are many cases where I use a dict which is mutable and can lead to all sorts of unintended behavior. For example, the base class Simulation has a dict as the default value for solver_parameters.
The text was updated successfully, but these errors were encountered:
https://docs.python-guide.org/writing/gotchas/#mutable-default-arguments
For the most part I did an okay job of using
None
as the default argument value and then setting the mutable value in__init__
; but there are many cases where I use adict
which is mutable and can lead to all sorts of unintended behavior. For example, the base classSimulation
has adict
as the default value forsolver_parameters
.The text was updated successfully, but these errors were encountered: