摘要:
1 函数的默认值为mutable类型时的问题和解决办法Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->deff2(a,L=[]):L.append(a)returnLprint(f2(1))print(f2(2))print(f2(3))deff3(a,L=None):ifLisNone:L=[]L.append(a)returnLprint(f3(1))print(f3(2))print(f3(3))#theresultwillbe#[1] 阅读全文