Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate a nested list and its elements? #269

Open
anh193 opened this issue Oct 20, 2021 · 1 comment
Open

Validate a nested list and its elements? #269

anh193 opened this issue Oct 20, 2021 · 1 comment

Comments

@anh193
Copy link

anh193 commented Oct 20, 2021

I have a validator as follows:
schema = Schema([And(list, lambda x: len(x) == 4)])
Here it validates a list of lists where each child list would have 4 elements.
Question is how should I modify this validator so that it could also verify the elements inside each child list, say they need to be of float type?

@anh193 anh193 changed the title Validate a nested list and its elements Validate a nested list and its elements? Oct 20, 2021
@londondaintta
Copy link

schema = Schema([And([float], lambda x: len(x) == 4)])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants