class_docstr: Compact implementation of the Thrift protocol driver.
class_docstr_tok: ["Compact","implementation","of","the","Thrift","protocol","driver","."]
code: def readMessageBegin(self):
      assert self.state == CLEAR
      proto_id = self.__readUByte()
      if proto_id != self.PROTOCOL_ID:
          raise TProtocolException(
              TProtocolException.BAD_VERSION,
              "Bad protocol id in the message: %d" % proto_id,
          )
      ver_type = self.__readUByte()
      type = (ver_type >> self.TYPE_SHIFT_AMOUNT) & self.TYPE_BITS
      version = ver_type & self.VERSION_MASK
      if version != self.VERSION:
          raise TProtocolException(
              TProtocolException.BAD_VERSION,
              "Bad version: %d (expect %d)" % (version, self.VERSION),
          )
      seqid = self.__readVarint()
      # the sequence is a compact "var int" which is treaded as unsigned,
      # however the sequence is actually signed...
      if seqid > 2147483647:
          seqid = -2147483648 - (2147483648 - seqid)
      name = binary_to_str(self.__readBinary())
      return (name, type, seqid)
  
imports: from .TProtocol import TType, TProtocolBase, TProtocolException, TProtocolFactory, checkIntegerLimits
  from struct import pack, unpack
  from ..compat import binary_to_str, str_to_binary
label_desc: Use image node_id 32 for calling the TCompactProtocol obj's underlying member method code with example usage: obj.readMessageBegin() and returns: name,  type,  seqid