Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add advice for fixing RUF008 when mutability is not desired
A common mistake in Python code is creating global mutable state by assigning class attributes that are mutable (e.g. a list or dictionary). `RUF012` helpfully catches this mistake and can be used to prevent inadvertent global state form being created. The description of that rule helpfully provides advice for adjusting code to stop beigng reported as an error *if the attribute should be mutable*, but does not say how the error can be avoided when mutability is not the goal. This change adds that advice, so that both possibilities are accounted for.
- Loading branch information