Skip to main content

remove_ctx

A decorator that removes the AppContext object from the function arguments if it is passed as the first positional argument.

def remove_ctx(
f: F
) - > F

Removes the application context from the arguments list if it is present as the first positional argument. This decorator ensures compatibility for functions that may be passed an AppContext instance but do not require it for their execution.

Parameters

NameTypeDescription
fFThe function to be wrapped and protected from receiving an unnecessary application context argument.

Returns

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