Skip to content

[MNT] remove mutable objects from defaults #1668

@fkiraly

Description

@fkiraly

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.

Metadata

Metadata

Labels

good first issueGood for newcomersmaintenanceContinuous integration, unit testing & package distribution

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions