Other folks (and I earlier) have explained why we think | is the better choice, if less obvious. On 2019-10-22 21:41, Steven D'Aprano wrote:
I think that is patronising to anyone, newbies and experienced programmers alike, who know and expect that merging dicts with an operator will have the same semantics as merging them with the update method.
Should we also force newcomers to give a moment's reflection on why item assignment ``mydict[key] = value`` is potentially "lossy"? How about ``mystring.replace(old, new)`` or opening a file for writing?
Even if they don't know what they are doing, it is not the place of the interpreter to treat them as an ignoramus that needs to be forced into reflecting on the consequences of their action, as if they were a naughty little schoolboy being told off by their headmaster.
This is an odd take, that a helpful error message is "patronising" and treats you like an ignoramus. The alternative, losing data is expected, builds character / "puts hair on your chest." This attitude reminds me of the bad old days on Slashdot. I had thought it had gone out of fashion after the tech community grew after the turn of the century. I'll take all the helpful error messages I can get personally, assuming they make sense. -Mike