append an element at the end of the buffer
(self,x)
| 3 | self.max = size_max |
| 4 | self.data = [] |
| 5 | def append(self,x): |
| 6 | """append an element at the end of the buffer""" |
| 7 | self.data.append(x) |
| 8 | if len(self.data) == self.max: |
| 9 | self.cur=0 |
| 10 | self.__class__ = RingBufferFull |
| 11 | def get(self): |
| 12 | """ return a list of elements from the oldest to the newest""" |
| 13 | return self.data |