Summary
mutable-argument-default (B006) doesn’t detect certain guaranteed-mutable expressions which should be simple to support: tuples containing mutable expressions, generator expressions, and assignment expressions containing mutable expressions. Example:
$ cat >b006.py <<'# EOF'
def f(x=([],), y=(y for y in "y"), z=(z := [])):
pass
# EOF
$ ruff --isolated check b006.py --select B006
All checks passed!
Version
ruff 0.12.9 (ef42246 2025-08-14)