def __rich_repr__(self) -> rich.repr.Result:
        """Requirement for pretty printing using the rich package."""

        # yield python_utils.class_name(type(self))

        # If this is a root repr, create a new set for already-formatted objects.
        tok = None
        if SerialModel.formatted_objects.get(None) is None:
            tok = SerialModel.formatted_objects.set(set())

        formatted_objects = SerialModel.formatted_objects.get()

        if formatted_objects is None:
            formatted_objects = set()

        if id(self) in formatted_objects:
            yield f"{python_utils.class_name(type(self))}@0x{id(self):x}"

            if tok is not None:
                SerialModel.formatted_objects.reset(tok)

            return

        formatted_objects.add(id(self))

        for k, v in self.__dict__.items():
            # This might result in recursive calls to __rich_repr__ of v.
            yield k, v

        if tok is not None:
            SerialModel.formatted_objects.reset(tok)
Requirement for pretty printing using the rich package.
src/core/trulens/core/utils/serial.py