def optional(parser, default=None):
    return choice(parser, lambda: default)
As per itertools.chain, but will only yield items not previously yielded.
dataset/ETHPy150Open brehaut/picoparse/picoparse/__init__.py/optional--crossover with--dataset/ETHPy150Open sqlboy/fileseq/test/run.py/_uchain