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

Function is_expandable

rich/pretty.py:398–405  ·  view source on GitHub ↗

Check if an object may be expanded by pretty print.

(obj: Any)

Source from the content-addressed store, hash-verified

396
397
398def is_expandable(obj: Any) -> bool:
399 """Check if an object may be expanded by pretty print."""
400 return (
401 _safe_isinstance(obj, _CONTAINERS)
402 or (is_dataclass(obj))
403 or (hasattr(obj, "__rich_repr__"))
404 or _is_attr_object(obj)
405 ) and not isclass(obj)
406
407
408@dataclass

Callers 1

_collect_renderablesMethod · 0.85

Calls 2

_safe_isinstanceFunction · 0.85
_is_attr_objectFunction · 0.85

Tested by

no test coverage detected