I have a two properties which holds lists. Whenever any item in this list changes, I would like the other list to update itself. This includes the statement obj.myProp
if you simply return your rows
or columns
list, then you'll never have any control about what happens when an item is changed.
one possibility would be not to provide properties to get/set the lists directly, but provide setters/getters for an item at position x/y.
a nice version would be to have __setitem__
/__getitem__
and have them accept a tuple, that way you could acces the elements using foo[x,y]
and foo[x,y] = bar
.
an other way would be to return a wrapper around the list that detects whe an element is changed, but then you'll also have to do that for every nested list.