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

Support kwargs for validators #8

Open
theteladras opened this issue May 6, 2022 · 0 comments
Open

Support kwargs for validators #8

theteladras opened this issue May 6, 2022 · 0 comments
Labels
good first issue Good for newcomers

Comments

@theteladras
Copy link
Owner

theteladras commented May 6, 2022

The idea would be to have the validator functions, which accept an dict options argument, to also support a variant of the methods that can accept options via kwargs.

For example the is_email validator, accepts as a second argument an options dict, like in this case:

is_email("some@value.py", { "allow_display_name": True })

The idea would be to have this method also accept kwargs with the same option properties with a lower precedence over the dict argument.

So the execution of the validator would end up something like this:

is_email("some@value.py", allow_display_name=True)
@theteladras theteladras added the good first issue Good for newcomers label May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant