What is wrong with def add(item, bucket=[]) as a function signature?
- A Nothing, it is idiomatic
- B The default list is created once at definition time and shared across all calls
- C Lists cannot be default arguments
- D It causes a syntax error
Answer
The default list is created once at definition time and shared across all calls
The mutable default persists between calls, accumulating values unexpectedly. Use None as the default and create the list inside the function.





