def min_length(minimum):
    """ Return a function that tests if values are the specified minimum length """
    def callback(value):
        """Accept a value to validate, return validation results"""
        if len(value) >= minimum:
            return True, None
        return False, ('"' + str(value) + '" is not a valid {}. It is too short.').format
    return callback