(obj: Any)
Check if a Python object is JSON-serializable.

    obj: The object to check.
    RETURNS (bool): Whether the object is JSON-serializable.
Check if a Python object is JSON-serializable.
Check if a Python object is JSON - serializable .
def is_json_serializable(obj: Any) -> bool:
    """Check if a Python object is JSON-serializable.

    obj: The object to check.
    RETURNS (bool): Whether the object is JSON-serializable.
    """
    if hasattr(obj, "__call__"):
        # Check this separately here to prevent infinite recursions
        return False
    try:
        ujson.dumps(obj)
        return True
    except (TypeError, OverflowError):
        return False
def is_json_serializable ( obj : Any ) -> bool : if hasattr ( obj , "__call__" ) : # Check this separately here to prevent infinite recursions return False try : ujson . dumps ( obj ) return True except ( TypeError , OverflowError ) : return False