Skip to content
Discussion options

You must be logged in to vote

I've had a chance to test this and I concur that putting the decorator above the @app.command() seems to have the effect that the wrapper function is never called. If I change the wrapper to the following, I am able to put the wrapper below the @app.command() and have it successfully run:

from functools import wraps

def test_wrap(func: Callable[..., Any]) -> Callable[..., Any]:
    @wraps(func)
    def wrapper(*args: tuple, **kwargs):
        print("Starting wrapper")
        return func(*args, **kwargs)

    return wrapper

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@adam-moss
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem
4 participants