Hacker News new | ask | show | jobs
by beanpup_py 2313 days 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

2 comments

And 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.

Python doesn't use formal interfaces. This makes dicts implement unions in a duck typeable way - the operators.
instead of actually useful features like dict deconstruction
The 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.