def content(self, value):
        """
        Set content to byte string, encoding if necessary
        """
        if isinstance(value, bytes):
            self._content = value
        else:
            self._content = value.encode(ENCODING)
        self.size = len(value)
def content ( self , value ) : if isinstance ( value , bytes ) : self . _content = value else : self . _content = value . encode ( ENCODING ) self . size = len ( value )
Set content to byte string, encoding if necessary