def _verify_alphabet(sequence):
 letters = sequence.alphabet.letters
 if (not letters):
  raise ValueError('Alphabet does not define letters.')
 for letter in sequence:
  if (letter not in letters):
   return False
 return True

def _verify_alphabet ( sequence ) : letters = sequence . alphabet . letters if ( not letters ) : raise ValueError ( 'Alphabet does not define letters.' ) for letter in sequence : if ( letter not in letters ) : return False return True
check all letters in sequence are in the alphabet .