def get_obj_name(obj):
    """Return printable name for objects or functions."""
    if hasattr(obj, 'name'):
        return obj.name
    elif hasattr(obj, 'func_name'):
        return obj.func_name
    else:
        return str(obj)
