def trim_chain_between(chain, start_res, end_res):
    """
    Remove all nucleotides between start_res and end_res, inclusive.

    The chain is modified in place so there is no return value.
    """
    to_detach = []
    for res in chain:
        if start_res <= res.id[1] and res.id[1] <= end_res:
            to_detach += [res]
    for res in to_detach:
        chain.detach_child(res.id)
