[Python-ideas] Dict joining using + and +=

Anders Hovmöller boxed at killingar.net
Wed Feb 27 13:22:10 EST 2019


I dislike the asymmetry with sets:

> {1} | {2}
{1, 2}

To me it makes sense that if + works for dict then it should for set too. 

/ Anders

> On 27 Feb 2019, at 17:25, 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/


More information about the Python-ideas mailing list