0
class speciallist(list):
def __new__(self):
return self
def custommethod(self,param):
#do stuff
return value
listesp = speciallist()
listesp.custommethod(param)
繼承我得到問題從列表
我認爲這是將調用從類中的方法,它爲什麼這樣做「結合的方法custommethod()必須與speciallist實例作爲第一個參數被稱爲」 ?
嘗試沒有'__new__' – 2010-12-04 15:17:41