def constraint_from_type(cls, value):
        """
        Returns the constraint callable given a value
        """
        if value is None:
            return None
        value_type = type(value)
        if value_type in (str, int, bool):
            return value_type
        raise ParameterError('Parameter type cannot be %s' % value_type)
def constraint_from_type ( cls , value ) : if value is None : return None value_type = type ( value ) if value_type in ( str , int , bool ) : return value_type raise ParameterError ( 'Parameter type cannot be %s' % value_type )
Returns the constraint callable given a value