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
Trafaret object to pass value as is #29
Comments
can You try |
try |
We probably have not the best docs, so will not close this now and will treat it as doc issue. |
I've tried trafaret.Any(). But it seems no luck:
|
|
Oh, I see. Thanks all. Also thank you for point me that trafaret is callable.
I prefer trafaret.Any() for readability. Thank you again. I enjoy to produce really beautifull code with this library. |
Hello and thank you for your work fiirst of all.
I have a small suggestion to use trafaret in more uniform way. I have some data with assigned trafaret and some without constraints. So I have to do something like this:
if data.trafaret:
val = data.trafaret.check_and_return(rawval)
else:
val = rawval
If you'll kindly add an object something like "NoCheck" which will pass arguments out without any check it will be possible to always do:
val = data.trafaret.check_and_return(rawval)
while data without constraints will be initialized as:
data.trafaret = trafaret.NoCheck()
The text was updated successfully, but these errors were encountered: