
I dislike adding more operator overload to builtin types.
str is not commutative, but it satisfies a in (a+b), and b in (a+b). There are no loss.
In case of dict + dict, it not only sum. There may be loss value.
{"a":1} + {"a":2} = ?
In case of a.update(b), it's clear that b wins. In case of a + b, "which wins" or "exception raised on duplicated key?" is unclear to me.
Regards,
On Thu, Feb 28, 2019 at 1:28 AM João Matos jcrmatos@gmail.com wrote:
Hello,
I would like to propose that instead of using this (applies to Py3.5 and upwards) dict_a = {**dict_a, **dict_b}
we could use dict_a = dict_a + dict_b
or even better dict_a += dict_b
Best regards,
João Matos
Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/