def convert_codonlist_to_tuplelist(seq_codons, codon_to_codon_extended):
    """Convert a list of triplets into a list of tuples, using a swaptable.

    The swaptable is a dict of triplet: triplets, and determines the
    allowed swaps.
    """
    codon_extended = [None] * len(seq_codons)
    for i, codon in enumerate(seq_codons):
        codon_extended[i] = codon_to_codon_extended[codon]
    return codon_extended
