def type_error_message(func_name: str, expected: str, got: str) -> str:
    """Return an error message for function func_name returning type got,
    where the correct return type is expected."""

    return ('{0} should return a {1}, but returned {2}' +
            '.').format(func_name, expected, got)