(self, other)
| 22 | |
| 23 | # Implement the "+" operator. Forward operands (MutInt + other) |
| 24 | def __add__(self, other): |
| 25 | if isinstance(other, MutInt): |
| 26 | return MutInt(self.value + other.value) |
| 27 | elif isinstance(other, int): |
| 28 | return MutInt(self.value + other) |
| 29 | else: |
| 30 | return NotImplemented |
| 31 | |
| 32 | # Support for reversed operands (other + MutInt) |
| 33 | __radd__ = __add__ |