Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Copying data is wasteful, mutating data is dangerous. Parent comment
If you are using a value type, `__iadd__`[1] can return a new value. So:
x = 5 y = x x += 3 y is not x and y == 5
x = [1, 2] y = x x += [3, 4] y is x and y == [1, 2, 3, 4]
There are no comments on this comment yet.
If you are using a value type, `__iadd__`[1] can return a new value. So:
But if you're using a reference type, it is allowed to mutate the reference and return the original reference. [1]: https://docs.python.org/3/reference/datamodel.html#object.__...