diff --git a/CHANGES.rst b/CHANGES.rst index 078df76a..00663b09 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -95,6 +95,8 @@ Unreleased functions. :pr:`4695` - It is now possible to also call ``@with_appcontext`` decorator with parenthesis, to have additional parity with Quart. +- The ``@with_appcontext`` decorator decorator has type hints. + Version 2.1.3 ------------- diff --git a/src/flask/cli.py b/src/flask/cli.py index 94acd3b6..1d923faa 100644 --- a/src/flask/cli.py +++ b/src/flask/cli.py @@ -408,7 +408,7 @@ class ScriptInfo: pass_script_info = click.make_pass_decorator(ScriptInfo, ensure=True) -def with_appcontext(f=None): +def with_appcontext(f: t.Optional[t.Callable] = None) -> t.Callable: """Wraps a callback so that it's guaranteed to be executed with the script's application context.