Dear all, Considering this test program:
def tst(a={}): print 1, a a['1'] = 1 print 2, a del a def tstb(a=[]): print 1, a a.append(1) print 2, a del a tst() tst() tstb() tstb() With output: t...@tnjx:~/tst> python tt.py 1 {} 2 {'1': 1} 1 {'1': 1} 2 {'1': 1} 1 [] 2 [1] 1 [1] 2 [1, 1] Would there be a way to ensure that the results does not depend on the previous call of the function. The desired output is: 1 {} 2 {'1': 1} 1 {} 2 {'1': 1} 1 [] 2 [1] 1 [] 2 [1] I know that tst({}) and tstb([]) will work, but is there any way to still use tst(), tstb()? Thanks in advance, Best regards, Johan -- http://mail.python.org/mailman/listinfo/python-list