piwebasync/api/util.py
def serialize_arbitrary_to_str(obj: ConvertsToStr) -> str:
    """
    Serialize arbitrary objects with a __str__ method. datetime converts to isoformat
    """
    if isinstance(obj, datetime):
        return obj.isoformat("T")
    elif hasattr(obj, "__str__"):
        return str(obj)
    else:
        raise SerializationError(
            f"Cannot serialize object of type {type(obj)} to str"
        )

    Serialize arbitrary objects with a __str__ method. datetime converts to isoformat
    
Serialize arbitrary objects with a __str__ method. datetime converts to isoformat
Serialize arbitrary objects with a __str__ method . datetime converts to isoformat
def serialize_arbitrary_to_str(obj: ConvertsToStr) -> str:
    if isinstance(obj, datetime):
        return obj.isoformat("T")
    elif hasattr(obj, "__str__"):
        return str(obj)
    else:
        raise SerializationError(
            f"Cannot serialize object of type {type(obj)} to str"
        )
def serialize_arbitrary_to_str ( obj : ConvertsToStr ) -> str : if isinstance ( obj , datetime ) : return obj . isoformat ( "T" ) elif hasattr ( obj , "__str__" ) : return str ( obj ) else : raise SerializationError ( f"Cannot serialize object of type {type(obj)} to str" )
Serialize arbitrary objects with a __str__ method.
Serialize arbitrary objects with a __str__ method .
"""
    Serialize arbitrary objects with a __str__ method. datetime converts to isoformat
    """
obj
ConvertsToStr