|
|
|
|
|
by rmbyrro
1559 days ago
|
|
This can be helpful in some cases, but it's precisely what I sometimes need to avoid, which is protecting a dictionary and having changes affecting only its own scope. If function A passes a dict to function B, I would like: 1) Function A to keep the dict intact while function B can manipulate its content; 2) Function A can change the dict after passing to B, and B still keep the original copy, unaware of A's later changes. One way of doing this is by deep copying dictionaries around, but it can easily become a big performance issue. |
|
[1]: https://pypi.org/project/cowdict/