[Python-ideas] Dict joining using + and +=
Karthikeyan
tir.karthi at gmail.com
Thu Feb 28 12:42:31 EST 2019
Just to add to the discussion this was brought up previously as part of PEP
448 unpacking generalizations that also added {**x, **y} to merge two dicts
in Python 3.5.
Previous python ideas thread :
https://mail.python.org/pipermail/python-ideas/2015-February/031748.html
LWN summary : https://lwn.net/Articles/635397/
The previous thread is worth reading as some of the points still stand even
with {**x, **y} added.
On Wed, Feb 27, 2019 at 9:59 PM João Matos <jcrmatos at 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 at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
Regards,
Karthikeyan S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190228/4fa6fce9/attachment.html>
More information about the Python-ideas
mailing list