def __init__(self, item_validator, min_items=None, max_items=None):
self.item_validator = item_validator<EOL>if min_items is not None:<EOL><INDENT>assert isinstance(min_items, numbers.Integral),'<STR_LIT>'<EOL>assert min_items >= <NUM_LIT:0>, '<STR_LIT>'<EOL><DEDENT>if max_items is not None:<EOL><INDENT>assert isinstance(max_items, numbers.Integral),'<STR_LIT>'<EOL>assert max_items > <NUM_LIT:0>, '<STR_LIT>'<EOL><DEDENT>if min_items is not None and max_items is not None:<EOL><INDENT>assert max_items >= min_items, '<STR_LIT>'<EOL><DEDENT>self.min_items = min_items<EOL>self.max_items = max_items<EOL>
Every list item will be validated with item_validator.