Skip to content
Myr

inheritance.py

This file

Path

examples/basic/inheritance.py

13 lines · 392 bytes · Python

Last changed by

Not known.

History of this file

Take it

The walk stopped after 200 commits: lines older than 35aa194 point at it.

Update oudated CutomLoader code example (#1185)Xinbin Huangbefore adoption35aa194

lines 1–13why, one step back
1from jinja2 import Environment
2from jinja2.loaders import DictLoader34env = Environment(5 loader=DictLoader(6 {7 "a": "[A[{% block body %}{% endblock %}]]",8 "b": "{% extends 'a' %}{% block body %}[B]{% endblock %}",9 "c": "{% extends 'b' %}{% block body %}###{{ super() }}###{% endblock %}",10 }11 )12)13print(env.get_template("c").render())