code: def checktype(self, val, kind, **kargs):
          
          if not isinstance(val, kind):
              raise TypeError('Expected {}; got {}'.format(
                              self.str_kind(kind), self.str_valtype(val)))
docs: Raise TypeError if val does not satisfy kind.