Add type hints for with_appcontext decorator

This commit is contained in:
Filip Š 2022-07-16 16:58:27 +02:00
parent 8d62f5e8c6
commit 8196dc0d12
2 changed files with 3 additions and 1 deletions

View file

@ -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
-------------

View file

@ -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.