Skip to main content

remove_ctx

A decorator that removes the AppContext argument from the function call if it is the first positional argument, ensuring compatibility with Flask's internal calling conventions.

def remove_ctx(
f: F
) - > F

Wraps a function to automatically strip an AppContext instance from the positional arguments if it is the first argument provided.

Parameters

NameTypeDescription
fFThe function to be wrapped, typically a Flask-related callback or method.

Returns

TypeDescription
FA wrapped version of the original function that filters out the application context argument before execution.