def is_digit(self):
if not isinstance(self.val, str_types):<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>if len(self.val) == <NUM_LIT:0>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if not self.val.isdigit():<EOL><INDENT>self._err('<STR_LIT>' % self.val)<EOL><DEDENT>return self<EOL>
Asserts that val is non-empty string and all characters are digits.