-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Introducing NeverUndefined
#1923
Comments
I don't plan on adding this to Jinja core. This doesn't match the general behavior of other |
I will release some extension for this. The reason I do this is because in Python we do not have such concept of |
Consider reopen this. I can tell you |
This feature is done by introducing a new type of undefined class called
NeverUndefined
.The problem is that when using the previously most restricted undefined policy
StrictUndefined
is not enough.Take example on the following template:
NeverUndefined
will capture this error because in the normal case one shall pass three parameters to this macro in order to call it.StrictUndefined
will not.And this problem would be harder to debug, if one pass these undefined variables to another macro or function calls.
Take another example:
StrictUndefined
will not throw error. It will produce:However,
NeverUndefined
will:The implementation:
The text was updated successfully, but these errors were encountered: