I just came across to this code , I know how variable length parameter works but i am confuse with this line func(*((userId,)+pargs)
def pwapi_auth(func):
def inner(authToken, *pargs, **kwargs):
# ...
users = {'a':0,
'b':1,
'c':2}
userId = users[authToken]
return func(*((userId,)+pargs), **kwargs)
return inner
>>> print getUsername('b')
Name_2
>>> changeUsername('b', 'New_Person')
>>> print getUsername('b')
New_Person