rendered paste body#!/usr/bin/env python
class A(object):
def __init__(self):
self.A = 'a'
self.B = 'b'
class B(object):
def __init__(self,AA):
self.AA = AA
def set(self):
self.AA.A = 'c'
class C(object):
def __init__(self,AA,LIST):
self.AA = AA
self.LIST = LIST
def disp(self):
print "displaying from one class ",self.AA.A," ",self.AA.B
print "are variables linked? :",self.LIST[0] is self.AA.A
if __name__ == '__main__':
tmp1 = A()
tmp_list = [tmp1.A,tmp1.B]
tmp2 = B(tmp1)
tmp3 = C(tmp1,tmp_list)
tmp3.disp()
tmp2.set()
tmp3.disp()