mutation — why your code mysteriously breaks7 / 9
shallow copy, deep copy, and the nested-dict bug
Cursor wrote a function that's supposed to take a config dict, return a
modified copy with debug set to True, and leave the original alone.
Right now the function mutates the original instead of copying it. The expected output is:
original debug: False
modified debug: True
Fix line 2 so the function works on a real copy.
The break is on line 2 — but read the whole snippet first.
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _