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

Use separate undefined object for else-less conditional expressions #1079

Merged
merged 2 commits into from Oct 13, 2019

Conversation

@ThiefMaster
Copy link
Member

ThiefMaster commented Oct 12, 2019

fixes #710

jinja2/environment.py Outdated Show resolved Hide resolved
@ThiefMaster ThiefMaster requested a review from davidism Oct 12, 2019
@davidism

This comment has been minimized.

Copy link
Member

davidism commented Oct 13, 2019

Do we need this to be configurable? It seems like the contract of value if condition is that it returns Undefined, maybe it can just be that simple.

@ThiefMaster

This comment has been minimized.

Copy link
Member Author

ThiefMaster commented Oct 13, 2019

That was my question ;) Then I'll change the default to use the undefined value if nothing is specified.

@ThiefMaster ThiefMaster force-pushed the ThiefMaster:cond-expr-undefined branch 2 times, most recently from 47bad3e to 28b848b Oct 13, 2019
@ThiefMaster

This comment was marked as outdated.

Copy link
Member Author

ThiefMaster commented Oct 13, 2019

updated

@ThiefMaster

This comment has been minimized.

Copy link
Member Author

ThiefMaster commented Oct 13, 2019

oh, I think I misread your comment, i thought you mean that it's supposed to return the undefined object by default (which is whatever is configured in the env as undefined).

@ThiefMaster ThiefMaster force-pushed the ThiefMaster:cond-expr-undefined branch from 28b848b to c4d3996 Oct 13, 2019
@ThiefMaster ThiefMaster force-pushed the ThiefMaster:cond-expr-undefined branch from 1a2ec72 to 4d331a0 Oct 13, 2019
@davidism davidism added this to the 2.11.0 milestone Oct 13, 2019
@davidism davidism merged commit 8146e45 into pallets:master Oct 13, 2019
10 checks passed
10 checks passed
Tests Build #20191013.8 succeeded
Details
Tests (Job Docs) Job Docs succeeded
Details
Tests (Job PyPy 3 Linux) Job PyPy 3 Linux succeeded
Details
Tests (Job Python 2.7 Linux) Job Python 2.7 Linux succeeded
Details
Tests (Job Python 2.7 Windows) Job Python 2.7 Windows succeeded
Details
Tests (Job Python 3.5 Linux) Job Python 3.5 Linux succeeded
Details
Tests (Job Python 3.6 Linux) Job Python 3.6 Linux succeeded
Details
Tests (Job Python 3.7 Linux) Job Python 3.7 Linux succeeded
Details
Tests (Job Python 3.7 Mac) Job Python 3.7 Mac succeeded
Details
Tests (Job Python 3.7 Windows) Job Python 3.7 Windows succeeded
Details
@ThiefMaster ThiefMaster deleted the ThiefMaster:cond-expr-undefined branch Oct 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.