title: jinja2 recursive loop vs dictionary
body: <p>I have the following dictionary:</p>
  
  <pre><code>{'a': {'b': {'c': {}}}}
  </code></pre>
  
  <p>And the following Jinja2 template:</p>
  
  <pre><code>            {% for key in dictionary recursive %}
  
              &lt;li&gt;{{ key }}
              {% if dictionary[key] %}
                  &lt;ul&gt;{{ loop(dictionary[key]) }}&lt;/ul&gt;
              {% endif %}
              &lt;/li&gt;
  
          {% endfor %}
  </code></pre>
  
  <p>But Jinja2 always output:</p>
  
  <pre><code>&lt;ul&gt;
      &lt;li&gt;a&lt;/li&gt;
      &lt;ul&gt;
          &lt;li&gt;b&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>My understood is that using recursive, it would show me the "c" element too, but it only works for a depth of 2. Why is <code>dictionary</code> not changing to the <code>dictionary[key]</code> at every loop iteration ? The <code>dictionary</code> is always the original <code>dictionary</code>.</p>