[Python-Dev] behavior of inplace operations

Guido van Rossum guido@python.org
Wed, 12 Jun 2002 11:51:53 -0400


> 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.

That's not sufficiently transparent for some purposes.

> 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

This is a known limitation.

--Guido van Rossum (home page: http://www.python.org/~guido/)