Skip to content
Myr

inheritance.py

This file

Path

examples/inheritance.py

12 lines · 341 bytes · Python

Last changed by

added super()Armin Ronacherbefore adoption62f8a29

History of this file

Take it

added super()Armin Ronacherbefore adoption62f8a29

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