コード例 #1
0
ファイル: p6ex3.py プロジェクト: posborne/learning-python
 def __init__(self, l):
     MyList.__init__(self, l)
     self.adds = 0 # this is an instance variable
コード例 #2
0
ファイル: p6ex3.py プロジェクト: posborne/learning-python
 def __add__(self, other):
     MySubList.calls += 1
     self.adds += 1
     return MyList.__add__(self, other)