
On Fri, Oct 18, 2019 at 02:39:41PM +0200, Richard Musil wrote:
``` a = dict(...) b = dict(...) c = a |< b ```
2) Anyone finding this in the code, who does not now about the operator, will _not_ guess the wrong operation.
That's certainly true, but only because they will have absolutely no clue at all about what |< could possibly mean. "Bitwise-or less-than" perhaps, whatever that could mean. You seem to have come up with a completely unique symbol which has, as far as I can tell, never been used before. As far as I can see, neither APL nor Perl use it as an operator. I can't see it in Unicode, or as an emoticon. Mathematicians are always coming up with new and obscure operators, so it's possible that somebody has used this before. (To me, it most looks like a variety of turnstile symbol |- or ⊢ used in logic.) If anyone wants to trawl through the 300+ pages and 14,000+ symbols in the comprehensive list of Latex symbols: http://mirror.aarnet.edu.au/pub/CTAN/info/symbols/comprehensive/symbols-a4.p... please be my guest. It could be interpreted as an attempt to render the "not less-than" mathematical symbol ≮ U+226E in pure ASCII Variants of that glyph sometimes use a vertical, rather than slanted, bar.
I know this has been somewhat addressed in PEP, but I simply cannot see, how adding another ambiguity to the '+' symbol, can be better, because the "familiarity" of '+' (which seems to me being an argument in the PEP) just hides the fundamental differences between this '+' and the other ones (arithmetic, or concatenation).
Perhaps it does. But inventing obscure and cryptic symbols like |< simply hides the fundamental similarities between adding two dictionaries and other forms of addition. Numerous people have independentally come up with the idea of using the plus symbol for adding two dicts. To many people, the use of + for this purpose is obvious and self-explanatory, and it is a reoccurring source of puzzlement why Python doesn't support dict addition. https://stackoverflow.com/questions/6005066/adding-dictionaries-together-pyt... But until now, I'm pretty sure that *nobody* before you thought of using the |< operator for dict addition. Congratulations :-) If this PEP accomplishes nothing else, at least it will be a single source of information about dict addition the next hundred times somebody asks "Why can't I add two dicts?" *wink* -- Steven