from typing import List


def flatten_list(my_list: List) -> List:
    """Flatten list so that it will be a list of non-list object.

    Args:
        my_list (List): List need to be flattened.

    Returns:
        List: Flattened list.
    """
    if not isinstance(my_list, list):
        raise ValueError("Input must be a list.")

    result = []
    for element in my_list:
        if isinstance(element, list):
            result.extend(flatten_list(element))
        else:
            result.append(element)

    return result