(self, payload)
Add the given payload to the current payload.

        The current payload will always be a list of objects after this method
        is called.  If you want to set the payload to a scalar object, use
        set_payload() instead.
Add the given payload to the current payload.
Add the given payload to the current payload .
def attach(self, payload):
        """Add the given payload to the current payload.

        The current payload will always be a list of objects after this method
        is called.  If you want to set the payload to a scalar object, use
        set_payload() instead.
        """
        if self._payload is None:
            self._payload = [payload]
        else:
            try:
                self._payload.append(payload)
            except AttributeError:
                raise TypeError("Attach is not valid on a message with a"
                                " non-multipart payload")
def attach ( self , payload ) : if self . _payload is None : self . _payload = [ payload ] else : try : self . _payload . append ( payload ) except AttributeError : raise TypeError ( "Attach is not valid on a message with a" " non-multipart payload" )