def register_type ( cls , name ) : x = TypeDefinition ( name , ( cls , ) , ( ) ) Validator . types_mapping [ name ] = x
how to define a type in python
Register name as a type to validate as an instance of class cls .
def register_type(cls, name):
    """Register `name` as a type to validate as an instance of class `cls`."""
    x = TypeDefinition(name, (cls,), ())
    Validator.types_mapping[name] = x