3 ms·
You’re right - I’m not suggesting that `+` should work in-place, but that `a += b` should do the same thing as `a = a + b` and not work in-place.
by pansa2 6y ago
You’re right - I’m not suggesting that `+` should work in-place, but that `a += b` should do the same thing as `a = a + b` and not work in-place.
- BerislavLopac 6y agoSo you're saying that a += b should create a new object and assign it to a? Now that would be even more unexpected...
- pansa2 6y agoI don’t think it’s unexpected for an augmented assignment operator to do an assignment. It is unexpected for it to instead call `extend`. It’s even worse to do the first for some types and the second for other types.