Issue: Found mutable default arguments ([], {}) in lora_base.py and related files. This is a classic Python bug pattern.
Problem: Mutable default arguments are created once at function definition time, and shared across all calls. This can cause unexpected state leaks between function calls.
Suggested fix:
# Before (buggy):
def some_function(arg=[]):
pass
# After (fixed):
def some_function(arg=None):
if arg is None:
arg = []
pass
This is a static analysis finding. There are multiple occurrences in this repository - please verify if these are actually reachable code paths.
Thanks for your work on diffusers and open source!
This issue was generated by Code Health Auditor
Issue: Found mutable default arguments (
[],{}) in lora_base.py and related files. This is a classic Python bug pattern.Problem: Mutable default arguments are created once at function definition time, and shared across all calls. This can cause unexpected state leaks between function calls.
Suggested fix:
This is a static analysis finding. There are multiple occurrences in this repository - please verify if these are actually reachable code paths.
Thanks for your work on diffusers and open source!
This issue was generated by Code Health Auditor