code: def _validate_type(self, item, name):
          
          if item is None:
              # don't validate None items, since they'll be caught by the portion
              # of the validator responsible for handling `required`ness
              return
  
          if not isinstance(item, self.allowed_types):
              item_class_name = item.__class__.__name__
              raise ArgumentError(name,
                  "Expected one of %s, but got `%s`" % (
                      self.allowed_types, item_class_name))
docs: Validate the item against `allowed_types`.