from typing import Any
import textwrap


def short_str(obj: Any) -> str:
    """ Returns a shortened string representation of `obj`, for use in error messages. """
    if isinstance(obj, str):
        return "\""+obj+"\""
    return textwrap.shorten(repr(obj), width=30, placeholder="...")