'Delete backwards using the characters in delim as boundaries.'

def _rubout(self, delim):

    widget = self._widget()
    if (widget is None):
        return
    cursor_position = widget.cursorPosition()
    text = widget.text()
    target_position = cursor_position
    is_boundary = True
    while (is_boundary and (target_position > 0)):
        is_boundary = (text[(target_position - 1)] in delim)
        target_position -= 1
    is_boundary = False
    while ((not is_boundary) and (target_position > 0)):
        is_boundary = (text[(target_position - 1)] in delim)
        target_position -= 1
    moveby = ((cursor_position - target_position) - 1)
    widget.cursorBackward(True, moveby)
    self._deleted[widget] = widget.selectedText()
    widget.del_()
