code: def default(self, o):
      
      if type(o) in _TYPE_TO_ENCODER:
        encoder = _TYPE_TO_ENCODER[type(o)]
        json_struct = encoder(o)
        json_struct[self.TYPE_ID] = type(o).__name__
        return json_struct
      return super(JsonEncoder, self).default(o)
docs: Inherit docs.