Misleading documentation using assert
statement for validation
#5596
Labels
documentation
use case
not really a feature or a bug; can be support for new DB features or user use cases not anticipated
Validators documentation presents validators using
assert
statement to validate data. However,assert
is a debug statement, which is disabled (and then validation using it) when run in optimized mode.assert
should only be used to ensure already trusted data, but I assume this is not the principal use case.That's why the documentation should be updated to replace this statement by raising a
ValueError
instead. A note could be added to explain whyassert
is not the statement you should use in validation, excepted if you know what you are doing.The text was updated successfully, but these errors were encountered: