Return a modified that returns the representation of expr, or '...' if
    that representation is longer than `max_len`

def _shorten_render(renderer, max_len):
    """Return a modified that returns the representation of expr, or '...' if
    that representation is longer than `max_len`"""

    def short_renderer(expr):
        res = renderer(expr)
        if len(res) > max_len:
            return '...'
        else:
            return res

    return short_renderer