From fa71f503c399bd35b4e3f8a2bc632d5e96c400df Mon Sep 17 00:00:00 2001 From: Boris Pavlovic Date: Tue, 22 Aug 2017 23:34:38 -0700 Subject: [PATCH] WIP: Improve Each Validator interface Use *validators instead of validators which improves interface: Each(Validator1, Validator2, Validator3) versus Each([Validator1, Validator2, Validator3]) --- lollipop/validators.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lollipop/validators.py b/lollipop/validators.py index c29b1da..7093e6e 100644 --- a/lollipop/validators.py +++ b/lollipop/validators.py @@ -316,10 +316,8 @@ class Each(Validator): 'invalid': 'Value should be collection', } - def __init__(self, validators, **kwargs): + def __init__(self, *validators, **kwargs): super(Validator, self).__init__(**kwargs) - if not is_sequence(validators): - validators = [validators] self.validators = validators def __call__(self, value, context=None):