Skip to content

Commit

Permalink
Add Known problems section to explain why the fix is unsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
cjolowicz committed Oct 21, 2023
1 parent 0a42887 commit 9edcb67
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 default 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=[]):
Expand Down

0 comments on commit 9edcb67

Please sign in to comment.