Is it possible to override += in Python?
Yes, override the __iadd__ method. Example:
__iadd__
def __iadd__(self, other): self.number += other.number return self
1.4m articles
1.4m replys
5 comments
57.0k users