Is it possible to override += in Python?
Yes, override the __iadd__ method. Example:
__iadd__
def __iadd__(self, other): self.number += other.number return self
548k questions
547k answers
4 comments
86.3k users