code: def check_type(self, value):
      
  
      if self.null and value is None:
        return
      if self.type is not None and not isinstance(value, self.type):
        msg = '{0!r} expected type {1}'
        raise TypeError(msg.format(self.full_name, self.type.__name__))
docs: Raises a #TypeError if *value* is not an instance of the field's #type.