diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/rules/mutable_argument_default.rs b/crates/ruff_linter/src/rules/flake8_bugbear/rules/mutable_argument_default.rs index e0208b472a7e35..9af7a6e3794a79 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/rules/mutable_argument_default.rs +++ b/crates/ruff_linter/src/rules/flake8_bugbear/rules/mutable_argument_default.rs @@ -30,6 +30,12 @@ use crate::checkers::ast::Checker; /// Types outside of the standard library can be marked as immutable with the /// [`flake8-bugbear.extend-immutable-calls`] configuration option. /// +/// ## Known problems +/// Mutable argument defaults can be used intentionally to cache computation +/// results. Replacing the argument with `None` or an immutable data structure +/// does not work for such usages. Instead, prefer the `@functools.lru_cache` +/// decorator from the standard library. +/// /// ## Example /// ```python /// def add_to_list(item, some_list=[]):