Skip to content

UUIDEncoder

fastagency.ui.mesop.message.UUIDEncoder #

Bases: JSONEncoder

default #

default(obj: object) -> object
Source code in fastagency/ui/mesop/message.py
def default(self, obj: object) -> object:
    if isinstance(obj, UUID):
        # if the obj is uuid, we simply return the value of uuid
        return obj.hex
    return json.JSONEncoder.default(self, obj)