From b53b290d73f653e2c88865ad87ccc54d8b9ff4d0 Mon Sep 17 00:00:00 2001 From: contributor Date: Mon, 23 Mar 2026 02:31:10 +0800 Subject: [PATCH] Add type annotation for FILTERS dict Fixes #2120 The FILTERS dict was missing a type annotation, causing Pylance to report partially unknown types for Environment.filters. This adds the annotation using the existing F TypeVar. --- src/jinja2/filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jinja2/filters.py b/src/jinja2/filters.py index c46e20c10..96287849c 100644 --- a/src/jinja2/filters.py +++ b/src/jinja2/filters.py @@ -1809,7 +1809,7 @@ async def async_select_or_reject( yield item -FILTERS = { +FILTERS: dict[str, F] = { "abs": abs, "attr": do_attr, "batch": do_batch,