MCPcopy
hub / github.com/Textualize/rich / is_renderable

Function is_renderable

rich/protocol.py:9–15  ·  view source on GitHub ↗

Check if an object may be rendered by Rich.

(check_object: Any)

Source from the content-addressed store, hash-verified

7
8
9def is_renderable(check_object: Any) -> bool:
10 """Check if an object may be rendered by Rich."""
11 return (
12 isinstance(check_object, str)
13 or hasattr(check_object, "__rich__")
14 or hasattr(check_object, "__rich_console__")
15 )
16
17
18def rich_cast(renderable: object) -> "RenderableType":

Callers 2

add_rowMethod · 0.85
getMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected