FEATURE This is an experimental feature, intended to enter into 1.99.2.
FEATURE
This is an experimental feature, intended to enter into 1.99.2.

Use case: the model has a container (which can be observable or not),
containing instances of observables (for example, instances of a class
derived from Observable). We want an observer observing the model, to
be notified when one of the instances contained into the container got
changed.

I added here experimental code which handles lists and maps, which
allows for declaring dynamically that a particular element of a
container is observable.

This is done through method Model.register_property(name), as name can
be now either:

1. the name of an OP declared statically (in __observables__)
2. the name of an observable declared dynamically.

E.g.

class MyModel (Model):
    def __init__(self):
        Model.__init__(self)

        # self.list and self.map are not observable here, althought
        # that might be observable of course.
        
        self.list = [ MyObservable() for i in range(5) ]
        ...
        for i in range(len(self.list)):
            self.register_property("list[%d]" % i)

This feature needs to be discussed. 

ps. I am adding also a (still non-automatic) test showing the complete
example for a list and a dict.



roboogle/gtkmvc3,roboogle/gtkmvc3