MCPcopy
hub / github.com/pallets/jinja / add_extension

Method add_extension

src/jinja2/environment.py:370–375  ·  view source on GitHub ↗

Adds an extension after the environment was created. .. versionadded:: 2.5

(self, extension: t.Union[str, t.Type["Extension"]])

Source from the content-addressed store, hash-verified

368 _environment_config_check(self)
369
370 def add_extension(self, extension: t.Union[str, t.Type["Extension"]]) -> None:
371 """Adds an extension after the environment was created.
372
373 .. versionadded:: 2.5
374 """
375 self.extensions.update(load_extensions(self, [extension]))
376
377 def extend(self, **attributes: t.Any) -> None:
378 """Add the items to the instance of the environment if they do not exist

Callers

nothing calls this directly

Calls 1

load_extensionsFunction · 0.85

Tested by

no test coverage detected