踩坑日记,参数*位置是很重要的!!!
class Dome():
def __init__(self):
pass
def verify(self, *args, name=None, **kwargs):
print(name, args, kwargs)
def verify2(self, name=None, *args, **kwargs):
print(name, args, kwargs)
if __name__=='__main__':
dome = Dome()
arg = [1,2,3,4,5,6]
dome.verify(name='test', *arg)
dome.verify(*arg, name='test')
dome.verify2(*[1, 2])
标签:__,args,name,位置,dome,参数,kwargs,arg,日记
From: https://www.cnblogs.com/apuyuseng/p/17789557.html