-
-
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
Reconsider returning the configured undefined for else-less ifs #2050
Comments
@ThiefMaster can you comment/decide on this? |
See #1079 for details. Initially I had implemented it to be configurable, but then we decided to keep it simple and use standard Can you come up with an actual example where this is a problem for you? I think Are you doing something like |
I do like the explanation in the changelog for that PR:
Hard to believe that was all the way back in 2019! I'm personally fine with the current behavior. Perhaps we need to add more explanation to the docs? |
Yes, exactly, we have a lot of things like |
(I would have just commented on #710 but it's locked)
The current behavior of always returning stock
Undefined
, regardless of the configuredundefined
class, is highly surprising. I understand the wish to be able to write{{ 'foo' if false }}
, but we use a lot ofif
clauses for setting variables or function parameters, and I would not have expected to findUndefined
instances when havingundefined
set to another class.I suggest to either return a different value depending on the context (this is probably difficult or at least annoying to implement), or always return a defined value like
None
.The text was updated successfully, but these errors were encountered: