On Mon, 2 Dec 2019, 23:55 Guido van Rossum, email@example.com wrote:
Also, + is already overloaded enough (numbers, strings, sequences) and we don't need yet another, different meaning. The | operator should be known to most users from sets (which are introduced before dicts in the official Python tutorial).
I don't particularly care about learnability or discoverability in this case -- I don't think beginners should be taught these operators as a major tool in their toolbox (let them use .update()), and for anyone wondering how to do something with a dict without access to the official docs, there's always help(dict). The natural way of discovering these would be through tutorials, reading of the library docs, or by reading other people's code, not by trying random key combinations in the REPL.
My feel about that is to favour the + operator. Technically | is better but mimicking lists, + might sound better. It follows the general trend in Py.
<<I don't think beginners should be taught these operators as a major tool in their toolbox>>
True, fits more of a "Python Tricks" session but sometimes according to the audiance level it is tempting to just mention it since it's one line away.
<<The natural way of discovering these would be through tutorials, ..., not by trying random key combinations in the REPL.>>