2005年08月09日 星期二 20:02
"小楼听雨"<hailang_0512 at 163.com> wrote: > def foo(par=[]): > if par is None: 这一句不为真 > par = [] > par.append(0) > print par > > foo() > print foo.func_defaults > > foo() > print foo.func_defaults > > foo([9]) > print foo.func_defaults > > foo() > print foo.func_defaults > > 结果是: > [] > ([],) #为什么不是([0],) > [] > ([],) > [9] > ([],) > [] > ([],) > 难道是par.append(0)的问题? > > _______________________________________________ > python-chinese list > python-chinese at lists.python.cn > http://python.cn/mailman/listinfo/python-chinese -- Dryice @ http://dryice.3322.org Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/sylvester-response.html -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 186 bytes Desc: not available Url : http://lists.exoweb.net/pipermail/python-chinese/attachments/20050809/d2ac667b/attachment.pgp
Zeuux © 2025
京ICP备05028076号