Skip to content

Commit

Permalink
Rich support (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
MicaelJarniac authored Oct 16, 2023
1 parent e3b44f4 commit 3514991
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/betterproto/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3514991

Please sign in to comment.