You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bazarr/libs/rich/protocol.py

13 lines
313 B

from typing import Any
from .abc import RichRenderable
def is_renderable(check_object: Any) -> bool:
"""Check if an object may be rendered by Rich."""
return (
isinstance(check_object, str)
or hasattr(check_object, "__rich__")
or hasattr(check_object, "__rich_console__")
)