Your question is Deep Clone and Pitfalls. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
The Twitch Creator Dashboard may need an independent copy of nested editor state before applying speculative updates. Implement deep_clone(obj) to clone a supported object graph without sharing mutable containers with the original.
The input may contain nested dictionaries and lists. Dictionary keys are strings, and leaf values are JSON-compatible primitives: strings, numbers, booleans, or None. The input can also contain repeated references or cycles, even though JSON examples cannot represent object identity directly.
TypeError for unsupported value types.def deep_clone(obj):