#!/usr/bin/python
## @package PySync
class pere:
index = None
def __init__(self, index):
self.index = index
return
class pere_list:
list = []
def __init__(self):
return
def add(self, element):
self.list.append(element)
return
def display(self):
for element in self.list:
element.display()
class enfant(pere):
def __init__(self, index):
pere.__init__(self, index)
return
def display(self):
print "(enfant) Mon indice est " + str(self.index)
return
class enfant_list(pere_list):
def __init__(self):
pere_list.__init__(self)
return
def add(self, index):
nfant = enfant(index)
pere_list.add(self, nfant)
class enfant2(pere):
def __init__(self, index):
pere.__init__(self, index)
return
def display(self):
print "(enfant2) Mon indice est " + str(self.index)
return
class enfant2_list(pere_list):
def __init__(self):
pere_list.__init__(self)
return
def add(self, index):
nfant2 = enfant2(index)
pere_list.add(self, nfant2)
list = enfant_list()
list2 = enfant2_list()
list.add(1)
list.add(2)
list2.add(4)
list2.add(5)
print "Contenu de la liste"
list.display()
print "Contenu de la liste 2"
list2.display()