Is '*args' useful in this example code?
Robert
rxjwg98 at gmail.com
Mon Jan 4 21:16:05 EST 2016
Hi,
I find an example code on wrap at this link:
http://stackoverflow.com/questions/308999/what-does-functools-wraps-do
Here is the code:
////////
def logged(func):
def with_logging(*args, **kwargs):
print func.__name__ + " was called"
return func(*args, **kwargs)
return with_logging
///////
I understand now, but I feel the args usage is weird. I don't see any way
to use *args and **kwargs in above code. What is your opinion on it?
Thanks,
More information about the Python-list
mailing list