Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Term:
- def __init__(self, value = 0):
- self.value = value
- def __iadd_(self, other):
- self.value += other.value
- return self
- f = Term()
- f += Term(2) # TypeError: unsupported operand type(s) for +=: 'instance' and 'instance'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement