You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all thanks a lot for creating this project.
I have a feature request, that other attrs users might also find useful.
attr.ib supports passing lists of validators, e.g. attr.ib(validators=[validator_foo, validator_bar]) instead of using the and_ validator.
This is not the case for deep_iterable(member_validator=...). To check 'foo' and 'bar' for each element in an iterable I currently need to use deep_iterable(member_validator=and_(validator_foo, validator_bar)) which I find less readable than deep_iterable(member_validator=[validator_foo, validator_bar])
I'm not sure if it is possible to add the same syntactic sugar to member_validator, but if so I think it would improve the new deep_iterable validators. Especially for validating nested iterables.
The text was updated successfully, but these errors were encountered:
First of all thanks a lot for creating this project.
I have a feature request, that other attrs users might also find useful.
attr.ib
supports passing lists of validators, e.g.attr.ib(validators=[validator_foo, validator_bar])
instead of using theand_
validator.This is not the case for
deep_iterable(member_validator=...)
. To check 'foo' and 'bar' for each element in an iterable I currently need to usedeep_iterable(member_validator=and_(validator_foo, validator_bar))
which I find less readable thandeep_iterable(member_validator=[validator_foo, validator_bar])
I'm not sure if it is possible to add the same syntactic sugar to
member_validator
, but if so I think it would improve the newdeep_iterable
validators. Especially for validating nested iterables.The text was updated successfully, but these errors were encountered: