Skip to content

Commit 1572d87

Browse files
authored
Merge pull request #2089 from Textualize/recursive-rich-cast
allow rich cast to return rich cast
2 parents ef1b9b9 + e23b0bb commit 1572d87

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rich/console.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,9 @@ def update_dimensions(self, width: int, height: int) -> "ConsoleOptions":
265265
class RichCast(Protocol):
266266
"""An object that may be 'cast' to a console renderable."""
267267

268-
def __rich__(self) -> Union["ConsoleRenderable", str]: # pragma: no cover
268+
def __rich__(
269+
self,
270+
) -> Union["ConsoleRenderable", "RichCast", str]: # pragma: no cover
269271
...
270272

271273

0 commit comments

Comments
 (0)