
Feb. 15, 2015
6:11 a.m.
Andrew Barnert wrote:
Consider any object with a cache that has to be invalidated when one of its members or attributes is set.
If obj were such an object, then obj.member.extend(foo) would fail to notify it of a change. Also, if obj1 and obj2 are sharing the same list, then obj1.member += foo would only notify obj1 of the change and not obj2. For these reasons, I wonder whether relying on a side effect of += to notify an object of changes is a good design. -- Greg