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

you guys are wonderful #21

Open
MirS0bhan opened this issue Aug 28, 2024 · 3 comments
Open

you guys are wonderful #21

MirS0bhan opened this issue Aug 28, 2024 · 3 comments

Comments

@MirS0bhan
Copy link

hi I'm in developing validata, something like attrs and pydantic but simple and without overhead
i have used your library for manage type validations but i have some problem. i see your half of code in validations is detecting what kind of type that is to get validate with appropriate validator. here we should define a validator_detector, because of the dataclass typing we have specified types and it will have overhead cause of validator detection. i think this could be solved. thank you guys

@sg495
Copy link
Contributor

sg495 commented Sep 22, 2024

Happy to look into this! Could you please give us a small snippet of code which exemplifies the overhead you're experiencing?

@MirS0bhan
Copy link
Author

in your code i see there is a lot of lines that supposed to detect the method to how validate the type.
so i think it could be better if you just create a validator function that gives a type and produce a validator for a specific type and that reduce the overhead of detecting type validator.

vltor = validator(List[int])
vltor([1,2,3])

@sg495
Copy link
Contributor

sg495 commented Nov 8, 2024

That's a very good idea! I'll look into implementing it in the next release :)

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