I'm decorating a function as such:
def some_abstract_decorator(func):
@another_lower_level_decorator
def wrapper(*args, **kwargs):
# ... details omitted
return func(*args, **kwargs)
return wrapper
This does what you'd expect (applies a low level decorator and then does some more stuff. My problem is that I now want to use functools.wraps
and I don't know where to put it. This is my guess, but I don't know if it'll have unintended consequences.
def some_abstract_decorator(func):
@wraps(func)
@another_lower_level_decorator
def wrapper(*args, **kwargs):
# ... details omitted
return func(*args, **kwargs)
return wrapper
(I of course apply wraps
inside of another_lower_level_decorator
as well)