We should ensure that no mutable objects are argument defaults, e.g., lists, dicts.
All mutable defaults should be replaced by appropriate defaults, e.g., strings if applicable, or None, which internally is then replaced by a newly initialized mutable defaults.
Care needs to be taken in cases where a self write happens, e.g., dataclass-like structures should not overwrite the self attr with a mutable default either, instead write the replacement default to self.
We should ensure that no mutable objects are argument defaults, e.g., lists, dicts.
All mutable defaults should be replaced by appropriate defaults, e.g., strings if applicable, or
None
, which internally is then replaced by a newly initialized mutable defaults.Care needs to be taken in cases where a
self
write happens, e.g., dataclass-like structures should not overwrite theself
attr with a mutable default either, instead write the replacement default toself
.