Discussion about this post

User's avatar
Scott Burson's avatar

That's a terrible implementation of persistent data structures in Python. The author seems to have missed the point altogether. What an update operation on a persistent data structure should do is to return the new value to the client; it's up to the client to decide which versions to hold onto, allowing the rest to be garbage-collected. Also, what makes these work in practice is precisely that they don't do an O(n) copy of the data structure for every update! Instead they copy only O(log n) tree nodes.

I hope you can find a better example.

Expand full comment
2 more comments...

No posts