我认为,许多人看到了得到缺省参数的假日功能。 例如:
def foo(a=[]):
a.append(3)
return a
如果我们使用“oo”来形容这一功能,那么在发出呼吁之后,产出将每增加3类。
在界定这一职能时,在目前环境中界定了称为“oo”的功能目标,同时对违约参数值进行评估。 每当该功能被称作无参数时,根据该代码,被评价的参数价值将发生变化。
My question is, where is this evaluated parameter exist? Is it in the function object or it is in the method object when calling the function? Since everything in python is a object, there must be some place to hold the name->value binding of a -->evaluated parameter. Am I over-thinking this problem?