def _first_iter_vals(iters):
    """Generate the first values of each iterator."""
    for it in iters:
        try:
            yield it.next()
        except StopIteration:
            yield None
Generate the first values of each iterator.
recipes/Python/576371_Merge_join_for_N_iterators/recipe-576371.py