Helper function to represent objects.

        Arguments:
            title: A title string displayed above the box containing
                the elements, or a pair of two strings that will be
                displayed left and right (e.g. a pair of brackets).
            elements: A list of (key, value) pairs, which will be
                displayed in a table in the order given.
            cls: A class to give to the result.
            short: Whether to use short or long form. Short form
                displays the elements as ``k=v``, appended horizontally.
                The alternative is a table, with associations stacked
                vertically.
            quote_string_keys: If True, string keys will be displayed
                with quotes around them. Default is False.
            delimiter: The character to use to separate key and
                value. By default '↦' if quote_string_keys is True.

def stdrepr_object(self, title, elements, *, cls=None,
                       short=False, quote_string_keys=False,
                       delimiter=None):
        """
        Helper function to represent objects.

        Arguments:
            title: A title string displayed above the box containing
                the elements, or a pair of two strings that will be
                displayed left and right (e.g. a pair of brackets).
            elements: A list of (key, value) pairs, which will be
                displayed in a table in the order given.
            cls: A class to give to the result.
            short: Whether to use short or long form. Short form
                displays the elements as ``k=v``, appended horizontally.
                The alternative is a table, with associations stacked
                vertically.
            quote_string_keys: If True, string keys will be displayed
                with quotes around them. Default is False.
            delimiter: The character to use to separate key and
                value. By default '↦' if quote_string_keys is True.
        """
        H = self.H

        if delimiter is None and quote_string_keys is True:
            delimiter = ' ↦ '

        def wrap(x):
            if not quote_string_keys and isinstance(x, str):
                return x
            else:
                return self(x)

        if short:
            contents = []
            for k, v in elements:
                kv = H.div['hrepr-object-kvpair'](
                    wrap(k),
                    delimiter or '',
                    self(v)
                )
                contents.append(kv)
        else:
            t = H.table()['hrepr-object-table']
            for k, v in elements:
                tr = H.tr(H.td(wrap(k)))
                if delimiter is not None:
                    tr = tr(H.td['hrepr-delimiter'](delimiter))
                tr = tr(H.td(self(v)))
                # t = t(H.tr(H.td(wrap(k)), H.td(self(v))))
                t = t(tr)
            contents = [t]

        title_brackets = isinstance(title, tuple) and len(title) == 2
        horizontal = short or title_brackets

        rval = self.titled_box(title, contents,
                               'h' if title_brackets else 'v',
                               'h' if short else 'v')

        if cls:
            rval = rval[cls]

        return rval