jinja2.environment.CodeGenerator.push_scope

CodeGenerator.push_scope(frame, extra_vars=())[source]

This function returns all the shadowed variables in a dict in the form name: alias and will write the required assignments into the current scope. No indentation takes place.

This also predefines locally declared variables from the loop body because under some circumstances it may be the case that

extra_vars is passed to Frame.find_shadowed.