code: def undo(self):
          ''' Undo the last action. '''
          if self.canundo():
              undoable = self._undos.pop()
              with self._pausereceiver():
                  try:
                      undoable.undo()
                  except:
                      self.clear()
                      raise
                  else:
                      self._redos.append(undoable)
              self.undocallback(f undo(self):
          ''' Undo the last action. '''
          if self.canundo():
              undoable = self._undos.pop()
              with self._pausereceiver():
                  try:
                      undoable.undo()
                  except:
                      self.clear()
                      raise
                  else:
                      self._redos.append(undoable)
              self.undocallback()
docs: Undo the last action.