37,742
社区成员
发帖
与我相关
我的任务
分享
>>> def a(word):
... print word
...
>>> def test(*args, **kargs):
... print 'args:', args
... print 'kargs:', kargs
... a(*args, **kargs)
...
>>> test('a', 'b', a='a', b='b')
args: ('a', 'b')
kargs: {'a': 'a', 'b': 'b'}
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
File "<interactive input>", line 4, in test
TypeError: a() takes exactly 1 non-keyword argument (2 given)
>>>