import typing


def type_error_message(fun_name: str, param_name: str, expected: str, actual: typing.Any) -> str:
    """ generates error message for TypeError """
    return f"In MediaComp.pictures.{fun_name}: {param_name} " +\
           f"expected a {expected}, actually {type(actual)}"