Comment by jbritton
10 hours ago
The article mentions shallow copy, but does this create a persistent immutable data structure? Does it modify all nodes up the tree to the root?
10 hours ago
The article mentions shallow copy, but does this create a persistent immutable data structure? Does it modify all nodes up the tree to the root?
Yes, if you modify a nested dict/list entry, all nodes above it will be cloned. Here's an example: