def repr_attributes(obj: object, *anonymous_elements: object, **named_elements: object) -> str:
    """
    A simple helper function that constructs a :func:`repr` form of an object. Used widely across the library.

    >>> class Aa: pass
    >>> assert repr_attributes(Aa()) == 'Aa()'
    >>> assert repr_attributes(Aa(), 123) == 'Aa(123)'
    >>> assert repr_attributes(Aa(), foo=123) == 'Aa(foo=123)'
    >>> assert repr_attributes(Aa(), 456, foo=123, bar='abc') == "Aa(456, foo=123, bar='abc')"
    """
    fld = list(map(repr, anonymous_elements)) + list(f'{name}={value!r}' for name, value in named_elements.items())
    return f'{type(obj).__name__}(' + ', '.join(fld) + ')'