From e23b0bb3da0bf782d394989b47669f7e75e8d98b Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Mon, 21 Mar 2022 16:55:18 +0000 Subject: [PATCH] allow rich cast to return rich cast --- rich/console.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rich/console.py b/rich/console.py index 6a0b3e90..f78f200b 100644 --- a/rich/console.py +++ b/rich/console.py @@ -265,7 +265,9 @@ class ConsoleOptions: class RichCast(Protocol): """An object that may be 'cast' to a console renderable.""" - def __rich__(self) -> Union["ConsoleRenderable", str]: # pragma: no cover + def __rich__( + self, + ) -> Union["ConsoleRenderable", "RichCast", str]: # pragma: no cover ...