<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def append(self, item):
 """Add new item to the list. If needed, append will first flush existing items and clear existing items. Args: item: an item to add to the list. """

    if self.should_flush():
      self.flush()
    self.items.append(item)