A template.backends.base._BaseTemplateprotocol class that imitates the abstract BaseTemplate class from DEP 182. This is needed because there is no real parent class from which each template backend inherits from, they implement their own Template classes from scratch. So, BaseEngine needed a return type for its abstract methods, which is what _BaseTemplate provides.
Other changes include reducing repetition, adding more specific Template types for the different backends, using more generic Mapping type instead of dict for template contexts.
Big improvements here are:
template.Template.render
now returnsSafeText
instead ofAny
.DjangoDivFormRenderer
andJinja2DivFormRenderer
informs.renderers
.template.backends.base._BaseTemplate
protocol class that imitates the abstractBaseTemplate
class from DEP 182. This is needed because there is no real parent class from which each template backend inherits from, they implement their ownTemplate
classes from scratch. So,BaseEngine
needed a return type for its abstract methods, which is what_BaseTemplate
provides.Other changes include reducing repetition, adding more specific Template types for the different backends, using more generic
Mapping
type instead ofdict
for template contexts.