diff --git a/src/betterproto/__init__.py b/src/betterproto/__init__.py index df8f3c6c6..da6e57fa8 100644 --- a/src/betterproto/__init__.py +++ b/src/betterproto/__init__.py @@ -790,6 +790,10 @@ def __repr__(self) -> str: ] return f"{self.__class__.__name__}({', '.join(parts)})" + def __rich_repr__(self) -> Iterable[Tuple[str, Any, Any]]: + for field_name in self._betterproto.sorted_field_names: + yield field_name, self.__raw_get(field_name), PLACEHOLDER + if not TYPE_CHECKING: def __getattribute__(self, name: str) -> Any: