Is i = i + n truly the same as i += n? [duplicate]
They don’t have to be the same. Using the + operator calls the method __add__ while using the += operator calls __iadd__. It is completely up to the object in question what happens when one of these methods is called. If you use x += y but x does not provide an __iadd__ method (or … Read more