jinja icon indicating copy to clipboard operation
jinja copied to clipboard

Render time only filter decorator

Open Louis-DR opened this issue 2 years ago • 1 comments

Added the @render_time_only decorator for filters and tests. It marks filters to not be resolved at compile time even if the arguments are constants. This can be useful as described in #1752 for time or memory intensive filters and tests, filters with global counting variables and changing global states, or filters that cause external actions such as printing, file operations or server requests.

The feature is tested by a new pytest, documented in changelog and the API documentation, passes pytest and tox (with a small tweak because mypy doesn't register set attributes).

Louis-DR avatar Nov 11 '22 20:11 Louis-DR

Relating to issue #1752, @davidism can you review this MR ? The checks are good, the changelog and documentation are also aligned. Thanks

Louis-DR avatar Dec 13 '22 09:12 Louis-DR