def digest_repr(obj):
    """ Return a short digest of a possibly deeply nested (JSON) object.
    """
    if isinstance(obj, (tuple, list, set, dict)):
        def nesting(collection):
            "Helper"
            if isinstance(collection, dict):
                collection = collection.values()
            if isinstance(collection, (tuple, list, set)):
                return 1 + max(nesting(i) for i in collection)
            else:
                return 1

        depth = nesting(obj)
        contents = list(obj)
        if len(contents) > 10:
            contents[3:-2] = "..."
        return "<%s of maxdepth %d and len %d holding %s>" % (
            type(obj).__name__, depth, len(obj), ', '.join(repr(i) for i in contents))
    else:
        return repr(obj)