Add type hints for with_appcontext decorator
This commit is contained in:
parent
8d62f5e8c6
commit
8196dc0d12
2 changed files with 3 additions and 1 deletions
|
|
@ -95,6 +95,8 @@ Unreleased
|
||||||
functions. :pr:`4695`
|
functions. :pr:`4695`
|
||||||
- It is now possible to also call ``@with_appcontext`` decorator
|
- It is now possible to also call ``@with_appcontext`` decorator
|
||||||
with parenthesis, to have additional parity with Quart.
|
with parenthesis, to have additional parity with Quart.
|
||||||
|
- The ``@with_appcontext`` decorator decorator has type hints.
|
||||||
|
|
||||||
|
|
||||||
Version 2.1.3
|
Version 2.1.3
|
||||||
-------------
|
-------------
|
||||||
|
|
|
||||||
|
|
@ -408,7 +408,7 @@ class ScriptInfo:
|
||||||
pass_script_info = click.make_pass_decorator(ScriptInfo, ensure=True)
|
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
|
"""Wraps a callback so that it's guaranteed to be executed with the
|
||||||
script's application context.
|
script's application context.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue