def validate_type_only(self, val):
if not issubclass(self.definition, type(val)):<EOL><INDENT>raise ValidationError('<STR_LIT>' %<EOL>(self.definition.__name__, generic_type_name(val)))<EOL><DEDENT>
Use this when you only want to validate that the type of an object
is correct, but not yet validate each field.

We check whether val is a Python parent class of the definition. This
is because Union subtyping works in the opposite direction of Python
inheritance. For example, if a union U2 extends U1 in Python, this
validator will accept U1 in places where U2 is expected.