JoelSjogren

__iadd__

Oct 22nd, 2012
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  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)
Advertisement
Add Comment
Please, Sign In to add comment