]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Add a note about the else statement. 112/head
authorChristoph Zwerschke <cito@online.de>
Wed, 21 Mar 2012 15:56:36 +0000 (16:56 +0100)
committerChristoph Zwerschke <cito@online.de>
Wed, 21 Mar 2012 15:56:36 +0000 (16:56 +0100)
docs/templates.rst

index a21e331031b5d216c518305f60f5887a0524e37b..4a145c138b636c2975c2d1d48ab615eed7348c20 100644 (file)
@@ -571,6 +571,10 @@ by using `else`::
     {% endfor %}
     </ul>
 
+Note that in Python `else` blocks are executed whenever the corresponding
+loop did not `break`.  Since in Jinja loops cannot `break` anyway,
+a slightly different behavior of the `else` keyword was chosen.
+
 It is also possible to use loops recursively.  This is useful if you are
 dealing with recursive data such as sitemaps.  To use loops recursively you
 basically have to add the `recursive` modifier to the loop definition and