def register_quantity(quantity, name):
    """Register `name` as a type to validate as an instance of class `cls`."""
    x = TypeDefinition(name, (quantity.__class__,), ())
    Validator.types_mapping[name] = x