Skip to content

Add type annotation for FILTERS dictionary#2135

Closed
Teylersf wants to merge 2 commits intopallets:mainfrom
Teylersf:fix-issue-2120
Closed

Add type annotation for FILTERS dictionary#2135
Teylersf wants to merge 2 commits intopallets:mainfrom
Teylersf:fix-issue-2120

Conversation

@Teylersf
Copy link
Copy Markdown

This PR adds an explicit type annotation t.Dict[str, t.Callable[..., t.Any]] to the FILTERS dictionary to improve type checking and IDE support.

Fixes #2120

@davidism davidism closed this Feb 12, 2026
Comment thread src/jinja2/filters.py Outdated
@@ -1,4 +1,4 @@
"""Built-in template filters used with the ``|`` operator."""
"""Built-in template filters used with the ``|`` operator."""
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change this line? What is the change?

@Teylersf
Copy link
Copy Markdown
Author

@davidism Thanks for catching that! That ? was added accidentally — it wasn't intentional. I'll revert that line back to the original docstring. Appreciate the sharp eye during review!

@Teylersf
Copy link
Copy Markdown
Author

@davidism The stray character has been fixed by pre-commit.ci in commit

@davidism
Copy link
Copy Markdown
Member

What "?" are you referring to. I see that pre-commit reverted something, but it looks exactly the same in both diffs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing type annotation for FILTERS

2 participants