def makeExpr(ch):
    expr = Word(ch).setParseAction(lambda tokens: [ch, len(tokens[0])])
return expr
expr = Each([Optional(makeExpr(ch)) for ch in 'abc'])
Pyparsing - where order of tokens in unpredictable