Re: [問題] default value for arguments..

看板Python作者 (BBS 2.0)時間16年前 (2009/02/18 14:31), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串4/4 (看更多)
簡單一句話:不要使用[],{}這種reference (pointer)性質的 東西當預設值。尤其是__init__裡。或者是 class level 的變數。 如: class A: a=[] def __int__(..... 我想這應該是原作想要表達的意義。 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.133.14.43

02/18 23:57, , 1F
不是 reference,而是 container
02/18 23:57, 1F
文章代碼(AID): #19cwidIe (Python)
文章代碼(AID): #19cwidIe (Python)