'Create a new Template of the appropriate class.'

def __new__(cls, template, *args, **kwargs):

    global _template_classes
    if (_template_classes is None):
        mgr = _get_template_extension_manager()
        _template_classes = dict(((tuple(name.split('.')), mgr[name].plugin) for name in mgr.names()))
    if (cls != Template):
        TemplateClass = cls
    else:
        TemplateClass = get_template_class(template)
    return super(Template, cls).__new__(TemplateClass)
