def to_json ( value , * * kwargs ) : serial_list = [ val . serialize ( * * kwargs ) if isinstance ( val , HasProperties ) else val for val in value ] return serial_list
custom json serialize python tuple
Return a copy of the tuple as a list
def to_json(value, **kwargs):
        """Return a copy of the tuple as a list

        If the tuple contains HasProperties instances, they are serialized.
        """
        serial_list = [
            val.serialize(**kwargs) if isinstance(val, HasProperties)
            else val for val in value
        ]
        return serial_list