Advertisement
JoelSjogren

Untitled

Oct 22nd, 2012
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Term:
  2.     def __init__(self, value = 0):
  3.         self.value = value
  4.        
  5.     def __iadd_(self, other):
  6.         self.value += other.value
  7.         return self
  8.        
  9. f = Term()
  10. f += Term(2) # TypeError: unsupported operand type(s) for +=: 'instance' and 'instance'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement