Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Class X(object):
- def notify(self):
- print "notifying..."
- Class A(object):
- def __init__(self):
- self.x = X()
- self.b = B(self.x)
- self.d = D(self.x)
- Class B(object):
- def __init__(self, x):
- self.x = x
- def notify(self):
- self.x.notify('from B')
- Class D(object):
- def __init__(self, x):
- self.x = x
- def notify(self):
- self.x.notify('from D')
- a = A()
Add Comment
Please, Sign In to add comment