7 ms·
No, it adds a new merge (|) and update (|=) operator to avoid using {**d1, **d2} because it apparently looks ugly[1]. [1]: https://www.python.org/dev/pe
by beanpup_py 7y ago
No, it adds a new merge (|) and update (|=) operator to avoid using
{**d1, **d2}
because it apparently looks ugly[1].
[1]: https://www.python.org/dev/peps/pep-0584/#d1-d2 https://www.python.org/dev/peps/pep-0584/#d1-d2
- privateSFacct 7y agoAnd in doing so creates multiple ways to do the same thing which is SUPER SUPER annoying. There has been a recent effort to add all these new operators that don't actually let you do anything you couldn't but now you can confuse everyone by doing it in other ways.
- banannaise 7y agoThe bigger reasons are discoverability (as noted in the section you linked) and the ever-vague notion of Pythonic-ness. {d1, d2} is not intuitive to a primarily-Python developer, and looks nothing like typical Python. The dict unpacking operator it uses is almost never seen outside function arguments.