@@ -0,0 +1,859 @@
+# Case 1: Immutable object (e.g. number-like)%0A# __iadd__ should not be defined, will be emulated using __add__%0A%0Aclass A:%0A%0A    def __init__(self, v):%0A        self.v = v%0A%0A    def __add__(self, o):%0A        return A(self.v + o.v)%0A%0A    def __repr__(self):%0A        return %22A(%25s)%22 %25 self.v%0A%0Aa = A(5)%0Ab = a%0Aa += A(3)%0Aprint(a)%0A# Should be original a's value, i.e. A(5)%0Aprint(b)%0A%0A# Case 2: Mutable object (e.g. list-like)%0A# __iadd__ should be defined%0A%0Aclass L:%0A%0A    def __init__(self, v):%0A        self.v = v%0A%0A    def __add__(self, o):%0A        # Should not be caled in this test%0A        print(%22L.__add__%22)%0A        return L(self.v + o.v)%0A%0A    def __iadd__(self, o):%0A        self.v += o.v%0A        return self%0A%0A    def __repr__(self):%0A        return %22L(%25s)%22 %25 self.v%0A%0Ac = L(%5B1, 2%5D)%0Ad = c%0Ac += L(%5B3, 4%5D)%0Aprint(c)%0A# Should be updated c's value, i.e. L(%5B1, 2, 3, 4%5D)%0Aprint(d)%0A

Test for inplace op fallback to normal one.