I looked on here, but it doesn't really help as my situation is different - my decorator takes 2 arguments, one of course is the function I want to decorate and the other is just a variable z.
The examples in the post you shown suggest adding another layer to my decorator function which doesn't achieve what I want.
I guess what I am trying to ask is how do I write this
The examples in the post you shown suggest adding another layer to my decorator function which doesn't achieve what I want.
def partial(func,z): def wrapper(first, second): first = first*z return func(first, second) return wrapper return partial @real_decorator(4) def add(first, second): return first+second
I guess what I am trying to ask is how do I write this
add = partial(add,4)as:
@partial def add(first, second) return first+secondwhere do I put the 4?