Consider a case where I change the kwargs
dict inside a method:
def print_arg(**kwargs):
print kwargs.pop('key')
If I call the method pop_arg
with a dictionary like this:
mydict = {'key':'value'}
print_arg(**mydict)
will mydict
be changed by this call?
I am also interested in a more detailed explanation of the underlying method calling mechanism that lets mydict
change or not.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…