(s)
Generate all Lyndon words over an s-symbol alphabet.
    The generation order is by length, then lexicographic within each length.
Generate all Lyndon words over an s-symbol alphabet.
    The generation order is by length, then lexicographic within each length.
Generate all Lyndon words over an s - symbol alphabet . The generation order is by length then lexicographic within each length .
def LyndonWords(s):
    """Generate all Lyndon words over an s-symbol alphabet.
    The generation order is by length, then lexicographic within each length."""
    n = 0
    while True:
        for w in LyndonWordsWithLength(s,n):
            yield w
        n += 1
def LyndonWords ( s ) : n = 0 while True : for w in LyndonWordsWithLength ( s , n ) : yield w n += 1