def is_type_of(self, some_type):
if type(some_type) is not type andnot issubclass(type(some_type), type):<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>if type(self.val) is not some_type:<EOL><INDENT>if hasattr(self.val, '<STR_LIT>'):<EOL><INDENT>t = self.val.__name__<EOL><DEDENT>elif hasattr(self.val, '<STR_LIT>'):<EOL><INDENT>t = self.val.__class__.__name__<EOL><DEDENT>else:<EOL><INDENT>t = '<STR_LIT>'<EOL><DEDENT>self._err('<STR_LIT>' % (self.val, t, some_type.__name__))<EOL><DEDENT>return self<EOL>
Asserts that val is of the given type.