from typing import Any


def summarize(obj: Any, max_length: int = 255) -> str:
    """Return a stringified representation of the object up to the given length."""
    stringified_obj = str(obj)

    if len(stringified_obj) <= max_length:
        return stringified_obj
    else:
        return stringified_obj[: max_length - 3] + "..."