def _auto_set_body()

in uamqp/message.py [0:0]


    def _auto_set_body(self, body):
        """
        Automatically detect the MessageBodyType and set data when no body type information is provided.
        We categorize object of type list/list of lists into ValueType (not into SequenceType) due to
        compatibility with old uamqp version.
        """
        if isinstance(body, (str, bytes)):
            self._body = DataBody(self._message)
            self._body.append(body)
        elif isinstance(body, list) and all([isinstance(b, (str, bytes)) for b in body]):
            self._body = DataBody(self._message)
            for value in body:
                self._body.append(value)
        else:
            self._body = ValueBody(self._message)
            self._body.set(body)