Skip to content

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

Merged
davidism merged 2 commits intopallets:masterfrom
ThiefMaster:cond-expr-undefined
Oct 13, 2019
Merged

Use separate undefined object for else-less conditional expressions#1079
davidism merged 2 commits intopallets:masterfrom
ThiefMaster:cond-expr-undefined

Conversation

@ThiefMaster
Copy link
Copy Markdown
Member

fixes #710

Comment thread jinja2/environment.py Outdated
@ThiefMaster ThiefMaster requested a review from davidism October 12, 2019 14:20
@davidism
Copy link
Copy Markdown
Member

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
Copy link
Copy Markdown
Member Author

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

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

This comment has been minimized.

@ThiefMaster
Copy link
Copy Markdown
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).

@davidism davidism added this to the 2.11.0 milestone Oct 13, 2019
@davidism davidism merged commit 8146e45 into pallets:master Oct 13, 2019
@ThiefMaster ThiefMaster deleted the cond-expr-undefined branch October 13, 2019 18:29
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

{{ 'foo' if false }} shortcut not usable with StrictUndefined

2 participants