It's no intuitive to me. I need to check documentation again every time encountered this to understand what it supposed to mean, which is a bad sign for language feature. Imagine having to check docs every time you encounter if ... else.
Jinja also has for ... else construct but the else will be executed if the loop not executed, like when the list is empty. This is intuitive to me, as it similar to how if ... else work. Either the primary block executed, or the else.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It's no intuitive to me. I need to check documentation again every time encountered this to understand what it supposed to mean, which is a bad sign for language feature. Imagine having to check docs every time you encounter
if ... else
.Jinja also has
for ... else
construct but theelse
will be executed if the loop not executed, like when the list is empty. This is intuitive to me, as it similar to howif ... else
work. Either the primary block executed, or theelse
.