from typing import Optional
from typing import Iterable


def split(to_split: str, sep: Optional[str] = None) -> Iterable[str]:
    """
    Django template for python's standard split function. Splits a string into a list of strings
    around a separator.

    :param to_split: The string to split
    :param sep: The separator characters to use as split markers.
    :return: A list of strings
    """
    if sep:
        return to_split.split(sep)
    return to_split.split()