These are chat archives for ipython/ipython

Mar 2018
Arun Kaliraja Baskaran
Mar 28 2018 13:25

Hi, I am trying to use the traitlets functionality for my project. Suppose if a trait is of instance of a particular class how do i observe change in value for a member of the class..


class A:
def init(self,val):
self.value = val

class myApp(HasTraits):
myA = Instance(A,kw={'val':2})

I want to have an observe method to be called if 'value' member variable of object myA is changed.. SOmething like below:

def onValueChange(self,change):

is it possible with the trailets implementation?