Adding rich methods to python classes ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Adding a method that returns a rich renderable to any python class makes it display this output if printed with rich. This also includes being nested inside... Date: December 23, 2021 Adding a __render__ method that returns a rich renderable to any python class makes it display this output if printed with rich. This also includes being nested inside a rich Layout. ``` import rich from rich.panel import Panel class ShowMe: def __rich__(self): return Panel("hello", border_style="gold1") if __name__ == "__main__": rich.print(ShowMe()) ``` Image: results of printing ShowMe with rich