jinja2.sandbox.SandboxedEnvironment.extend

SandboxedEnvironment.extend(**attributes)

Add the items to the instance of the environment if they do not exist yet. This is used by extensions to register callbacks and configuration values without breaking inheritance.