def __add__(self, otherlist): self.countadd += 1 MyListSub.count += 1 self.outcount() if isinstance(otherlist, MyListSub): otherlist = otherlist.data return MyListSub(MyList.__add__(self, otherlist))
def __add__(self, other): print('add: ' + str(other)) MyListSub.calls += 1 # Class-wide counter self.adds += 1 # Per-instance counts return MyList.__add__(self, other)
def __add__(self, other): MyListSub.calls += 1 self.adds += 1 return MyList.__add__(self,other)
def __add__(self, other): MyListSub.calls = MyListSub.calls + 1 # Class-wide counter self.adds = self.adds + 1 # Per instance counts return MyList.__add__(self, other)
def __add__(self, other): print 'add:',str(other) MyListSub.calls += 1 self.adds += 1 return MyList.__add__(self, other)
def __add__(self, other): MyListSub.calls += 1 self.adds += 1 return MyList.__add__(self, other)