I having difficulties to understand the instance of an object in a list. How to save the value of an object into a list without saving the instance? This is not possible isnt it? The colde below works but i would like to avoid to use .value as i might have several parameters.. not sure if i am clear enough..
class BougieBuffer:
def __init__(self):
self.bougiebuffer=deque(maxlen = 10000)
self.maximum = Maximum()
def update(self,bougie):
self.maximum.value = random.randint(-1,1)
bougie.maximum.value = self.maximum.value
self.bougiebuffer.append(bougie)
print len(self.bougiebuffer)
for i in range (len(self.bougiebuffer),0,-1):
print self.bougiebuffer[i-1].prixFermeture, self.bougiebuffer[i-1].maximum.value
I would have wrote naturally something like below but obviously this is not working and it returns the same value for all
bougie.maximum = self.maximum
Maximum()instance to assign to the other class.