def get_bonds(struct):
    """Get a list of bonds in a dot-paren structure."""
    struct = struct.replace('+', '')
    bonds = []
    open_pos = []
    for pos, symb in enumerate(struct):
        if symb == '(':
            open_pos.append(pos)
        elif symb == ')':
            assert len(open_pos) != 0
            start = open_pos.pop()
            bonds.append((start, pos))
        else:
            assert symb == '.', "Structure '%s' not in dot-paren form" % struct
    return bonds
