⬅︎ Back to Be careful with using dict() to create a copy
Dicts have a copy method right away! d = {'asdf': ['value']} dd = d.copy() dd['asdf'] = ['other'] d # Result: {'asdf': ['value']} # dd # Result: {'asdf': ['other']} # (can it really be!? I contributed something?!! :D)
Comment
Dicts have a copy method right away!
d = {'asdf': ['value']}
dd = d.copy()
dd['asdf'] = ['other']
d
# Result: {'asdf': ['value']} #
dd
# Result: {'asdf': ['other']} #
(can it really be!? I contributed something?!! :D)