def __str__(self):
        """Used when printing out the exception message."""
        if self._message:
            return self._message
        # Otherwise construct the message
        var = self._var_name
        val = self._var_value
        atn = self._var_type_name
        etn = self._exp_type_name or ""
        article = "an" if etn.lstrip("?")[0] in "aioeH" else "a"
        return "Argument `{var}` should be {an} {expected_type}, got {actual_type} {value}".\
               format(var=var, an=article, expected_type=etn, actual_type=atn, value=val)
def __str__ ( self ) : if self . _message : return self . _message var = self . _var_name val = self . _var_value atn = self . _var_type_name etn = self . _exp_type_name or "" article = "an" if etn . lstrip ( "?" ) [ 0 ] in "aioeH" else "a" return "Argument `{var}` should be {an} {expected_type}, got {actual_type} {value}" . format ( var = var , an = article , expected_type = etn , actual_type = atn , value = val )
Used when printing out the exception message.