unicode strings is that Python 2.x is not using unicode for exceptions
and tracebacks as well as the compiler. This will change with Python 3.
+.. autoexception:: jinja2.TemplateRuntimeError
+
.. autoexception:: jinja2.TemplateAssertionError
did not iterate
{% endfor %}
+ As of version 2.10 more complex use cases can be handled using namespace
+ objects which allow propagating of changes across scopes::
+
+ {% set ns = namespace(found=false) %}
+ {% for item in items %}
+ {% if item.check_something() %}
+ {% set ns.found = true %}
+ {% endif %}
+ * {{ item.title }}
+ {% endfor %}
+ Found item having something: {{ ns.found }}
+
+ Note hat the ``obj.attr`` notation in the `set` tag is only allowed for
+ namespace objects; attempting to assign an attribute on any other object
+ will raise an exception.
+
+ .. versionadded:: 2.10 Added support for namespace objects
+
Block Assignments
~~~~~~~~~~~~~~~~~
.. versionadded:: 2.1
+.. class:: namespace(...)
+
+ Creates a new container that allows attribute assignment using the
+ ``{% set %}`` tag::
+
+ {% set ns = namespace() %}
+ {% set ns.foo = 'bar' %}
+
+ The main purpose of this is to allow carrying a value from within a loop
+ body to an outer scope. Initial values can be provided as a dict, as
+ keyword arguments, or both (same behavior as Python's `dict` constructor)::
+
+ {% set ns = namespace(found=false) %}
+ {% for item in items %}
+ {% if item.check_something() %}
+ {% set ns.found = true %}
+ {% endif %}
+ * {{ item.title }}
+ {% endfor %}
+ Found item having something: {{ ns.found }}
+
+ .. versionadded:: 2.10
+
Extensions
----------