We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Comparisons in jinja don't behave like comparisons in Python.
template = '''{{4 < 2 < 3}} {{a < b < c}}''' t = Template(template) print(t.render(a = 4, b = 2, c = 3))
False False
True False
Python code:
4 < 2 < 3
Output: False
False
The problem lies in
jinja/jinja2/nodes.py
Lines 775 to 780 in 1af1205
I would like to submit a PR for this.
The text was updated successfully, but these errors were encountered:
PRs welcome
Sorry, something went wrong.
nodes.py: Return on first false in Compare() expr
154f74a
Closes: pallets#1102
Successfully merging a pull request may close this issue.
Comparisons in jinja don't behave like comparisons in Python.
Expected output:
Output:
Python code:
Output:
False
The problem lies in
jinja/jinja2/nodes.py
Lines 775 to 780 in 1af1205
where the result of the comparison depends only on the final operator result.
I would like to submit a PR for this.
The text was updated successfully, but these errors were encountered: