From: "Guido van Rossum" <guido@python.org> > > That's right. I would have suggested that for persistent containers, the > > object returned carries its own write-back knowledge. > > But that's not how it works. Giving each container a persistent > object ID is not an option. I'm sure this is moot, but I don't think I was suggesting that. I was suggesting that a persistent container's __getitem__() returns a proxy object which contains a reference back to the container. You can either write-back upon modifying the object, or, I suppose, upon __del__(). My scheme may not work (I don't really understand the Zope requirements or implementation), but it seems that the existing one is just as vulnerable in the case of a container of mutable objects: x = container_of_lists[2] x += 3 # no write-back -Dave
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4