Skip to content

Commit 8e589da

Browse files
authored
Fix typing of jinja decorators (#4109)
1 parent a960236 commit 8e589da

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Unreleased
88
- Fix type annotation for ``teardown_request``. :issue:`4093`
99
- Fix type annotation for ``before_request`` and ``before_app_request``
1010
decorators. :issue:`4104`
11+
- Fixed the issue where typing requires template global
12+
decorators to accept functions with no arguments. :issue:`4098`
1113

1214

1315
Version 2.0.1

src/flask/typing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
ErrorHandlerCallable = t.Callable[[Exception], ResponseReturnValue]
4141
TeardownCallable = t.Callable[[t.Optional[BaseException]], None]
4242
TemplateContextProcessorCallable = t.Callable[[], t.Dict[str, t.Any]]
43-
TemplateFilterCallable = t.Callable[[t.Any], str]
44-
TemplateGlobalCallable = t.Callable[[], t.Any]
45-
TemplateTestCallable = t.Callable[[t.Any], bool]
43+
TemplateFilterCallable = t.Callable[..., t.Any]
44+
TemplateGlobalCallable = t.Callable[..., t.Any]
45+
TemplateTestCallable = t.Callable[..., bool]
4646
URLDefaultCallable = t.Callable[[str, dict], None]
4747
URLValuePreprocessorCallable = t.Callable[[t.Optional[str], t.Optional[dict]], None]

0 commit comments

Comments
 (0)