On Thu, 28 Feb 2019 at 07:18, Serhiy Storchaka <[email protected]> wrote:
> [...]
>
> I do not understand why we discuss a new syntax for dict merging if we
> already have a syntax for dict merging: {**d1, **d2} (which works with
> *all* mappings). Is not this contradicts the Zen?
>
FWIW there are already three ways for lists/sequences:
[*x, *y]
x + y
x.extend(y) # in-place version
We already have first and third for dicts/mappings, I don't see a big
problem in adding a + for dicts,
also this is not really a new syntax, just implementing couple dunders for
a builtin class.
So I actually like this idea.
--
Ivan
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/