Iadd
Iadd typically refers to the in-place addition operator, commonly written as the plus-equals symbol (+=). In many programming languages, including Python, iadd denotes the operation of adding a value to another and storing the result back in the original variable, potentially modifying the object in place.
In Python, the behavior of a += b is governed by the special method __iadd__ on the left-hand
- For a list: lst = [1, 2, 3]; lst += [4, 5] results in lst being [1, 2, 3,
- For a tuple: tup = (1, 2); tup += (3,) results in tup becoming (1, 2, 3) because
Not all types implement in-place addition. Some objects rely on immutable semantics, or provide alternative methods