class_docstr: Compact implementation of the Thrift protocol driver.
class_docstr_tok: ["Compact","implementation","of","the","Thrift","protocol","driver","."]
code: def writeMapBegin(self, ktype, vtype, size):
      assert self.state in (VALUE_WRITE, CONTAINER_WRITE), self.state
      if size == 0:
          self.__writeByte(0)
      else:
          self.__writeSize(size)
          self.__writeUByte(CTYPES[ktype] << 4 | CTYPES[vtype])
      self.__containers.append(self.state)
      self.state = CONTAINER_WRITE
  
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 18 for calling the TCompactProtocol obj's underlying member method code with example usage: obj.writeMapBegin(ktype, vtype, size) without return types