{% macro typeof(thing) %} {% if thing is iterable %} {% if thing is object %} dict {% else %} list {% endif %} {% else %} {% if thing is string %} str {% elif thing is number %} num {% else %} other {% endif %} {% endif %} {% endmacro typeof %} {% macro debug(thing, label="", recurse=0) %} {% set type = self::typeof(thing=thing) | trim %} {% if label %}{{ label }}: {% endif %}{{ type }} {% set rdepth = recurse - 1 %}