'Construct a template loader.
:arg str autoescape: The name of a function in the template
namespace, such as "xhtml_escape", or ``None`` to disable
autoescaping by default.
:arg dict namespace: A dictionary to be added to the default template
namespace, or ``None``.
:arg str whitespace: A string specifying default behavior for
whitespace in templates; see `filter_whitespace` for options.
Default is "single" for files ending in ".html" and ".js" and
"all" for other files.
.. versionchanged:: 4.3
Added ``whitespace`` parameter.'

def __init__(self, autoescape=_DEFAULT_AUTOESCAPE, namespace=None, whitespace=None):

    self.autoescape = autoescape
    self.namespace = (namespace or {})
    self.whitespace = whitespace
    self.templates = {}
    self.lock = threading.RLock()
