def split(orig, sep=None):
    exp = re.compile(r'\s+' if sep is None else re.escape(sep))
    pos = 0
    length = len(orig)
    while True:
        match = exp.search(orig, pos)
        if not match:
            if pos < length or sep is not None:
                val = orig[pos:]
                if val:
                    # Only yield a value if the slice was not an empty string,
                    # because if it is then we've reached the end. This keeps
                    # us from yielding an extra blank value at the end.
                    yield val
            break
        if pos < match.start() or sep is not None:
            yield orig[pos:match.start()]
        pos = match.end()
Default is a temporary redirect
dataset/ETHPy150Open saltstack/salt/salt/utils/itertools.py/split--crossover with--dataset/ETHPy150Open django/django/tests/generic_views/test_base.py/RedirectViewTest.test_redirect_HEAD