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 global checker #8

Open
smarie opened this issue Sep 7, 2019 · 2 comments
Open

Support global checker #8

smarie opened this issue Sep 7, 2019 · 2 comments

Comments

@smarie
Copy link
Owner

smarie commented Sep 7, 2019

if the class contains a __validate_all_fields__(self) method, it will be called everytime a field is modified. This is quite heavy but might be useful in some rare cases where validation can not be done in each of the fields validators

  • you can disable this temporarily by doing "with skip_global_validation(o): ..." (implementation note: this would set a __skip_global_validation__ flag on the instance, read by the fields setters)

  • or permanently with set_global_validation(o, enabled=False) ?

@smarie
Copy link
Owner Author

smarie commented Sep 9, 2019

Do we really want that kind of complexity ? Real-world evidence needed

@smarie
Copy link
Owner Author

smarie commented Sep 9, 2019

This is an equivalent functionality :
https://zopeinterface.readthedocs.io/en/latest/README.html#invariants

@smarie smarie transferred this issue from smarie/python-mixture Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant