docs: def send(self, obj, encoding='utf-8'):
          """
          Sends a python object to the backend. The object **must be JSON
          serialisable**.
  
          :param obj: object to send
          :param encoding: encoding used to encode the json message into a
              bytes array, this should match CodeEdit.file.encoding.
          """
          comm('sending request: %r', obj)
          msg = json.dumps(obj)
          msg = msg.encode(encoding)
          header = struct.pack('=I', len(msg))
          self.write(header)
          self.write(msg)