Oct. 22, 2019
12:16 p.m.
On 22/10/2019 06:43, Richard Musil wrote:
It is not a "concatenation" though, because you lost {"key1": "val1"} in the process. The concatenation is not _just_ "writing something after something", you can do it with anything, but the actual operation, producing the result.
My point is that if I saw {"key1": "val1", "key2": "val2"} + {"key1": "val3"}, I would expect that it would be equivalent to {"key1": "val1", "key2": "val2", "key1": "val3"}. Similarly, I would expect that deque([1, 2, 3], maxlen=4) + deque([4, 5]) == deque([1, 2, 3, 4, 5], maxlen=4) == deque([2, 3, 4, 5], maxlen=4) which indeed is true.