def toString(self, inObject):
        """
        Serialize the given list of objects to a single string.
        """
        strings = []
        for obj in inObject:
            serialized = self.elementType.toString(obj)
            strings.append(pack('!H', len(serialized)))
            strings.append(serialized)
        return b''.join(strings)

        Serialize the given list of objects to a single string.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/protocols/amp.py