kwargs.pop
pop(key[, default]) if key is in the dictionary, remove it and return its value, else return default. If default is not given and key is not in the dictionary, a KeyError is raised.
kwargs.pop()的作用是将字典中指定的键移除,并返回其对应的值。如果字典中没有指定的键,则返回默认值,没有设置默认值的话就报错。
1 | |
参考
kwargs.pop
http://yojayc.github.io/2021/06/14/kwargs-pop/