def next_or_none(seq):
    """
    Gets an iterator-like function for sequence.  Instead of raising a
    StopIteration exception, the function returns None when the sequence
    is exhausted.

    :param seq: The sequence to iterate over.
    :returns: The iterator-like function.
    """
    def _next():
        try:
            return next(_iter)
        except StopIteration:
            return None

    _iter = iter(seq)
    return _next