Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我很困惑一个 * 和两个 ** 在参数前面的作用。
def wrapper(*args, **wdargs):
这意味着关键字参数。
例如。
func(x, y, foo='a') # where foo is a keyword argument
它们用于接受可变数量的争论。看看这个:http: //www.saltycrane.com/blog/2008/01/how-to-use-args-and-kwargs-in-python/