from typing import List
import re


def _split_statements(text: str) -> List[str]:
    """Splits a string on `\n` and `;`.
    
    Examples
    --------
    >>> _split_statements('print()\\nassert True')
    ['print()', 'assert True']
    >>> _split_statements('print() ; assert True')
    ['print()', 'assert True']
    """
    # If you see closely in the first example in the docstring,
    # You'll notice that the newline is written as `\\n` rather than `\n`.
    # This is because `\n` is converted to a real newline when parsed as a docstring
    # and messes up doctest and reader-side of the docstring!
    split_text = re.split(r"\n|;", text)
    return [line.strip() for line in split_text if line]