-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
When using Jinja2 with filters, Pylance is screaming at me because Environment.filters is partially unknown.
Environment.filters is copied from here:
Line 1812 in 5ef7011
| FILTERS = { |
FILTERS does not have a type annotation.
You already defined a TypeVar for the expected signature here:
Line 44 in 5ef7011
| F = t.TypeVar("F", bound=t.Callable[..., t.Any]) |
Is there a specific reason to leave out the annotation? I'd be happy to submit a PR.
# Suggested code
FILTERS: dict[str, F] = {Best,
Gab
Environment:
- Python version: 3.12
- Jinja version: 3.1.6
- I searched for other issues with the keywords
typeandfilter - I tested the suggested changes locally by modifying jinja in my venv
Metadata
Metadata
Assignees
Labels
No labels