def _check_type_compatible(alphabets):
 (dna, rna, nucl, protein) = (False, False, False, False)
 for alpha in alphabets:
  a = _get_base_alphabet(alpha)
  if isinstance(a, DNAAlphabet):
   dna = True
   nucl = True
   if (rna or protein):
    return False
  elif isinstance(a, RNAAlphabet):
   rna = True
   nucl = True
   if (dna or protein):
    return False
  elif isinstance(a, NucleotideAlphabet):
   nucl = True
   if protein:
    return False
  elif isinstance(a, ProteinAlphabet):
   protein = True
   if nucl:
    return False
 return True

def _check_type_compatible ( alphabets ) : ( dna , rna , nucl , protein ) = ( False , False , False , False ) for alpha in alphabets : a = _get_base_alphabet ( alpha ) if isinstance ( a , DNAAlphabet ) : dna = True nucl = True if ( rna or protein ) : return False elif isinstance ( a , RNAAlphabet ) : rna = True nucl = True if ( dna or protein ) : return False elif isinstance ( a , NucleotideAlphabet ) : nucl = True if protein : return False elif isinstance ( a , ProteinAlphabet ) : protein = True if nucl : return False return True
returns true except for dna+rna or nucleotide+protein .