On Mon, 21 Oct 2019 at 14:55, David Mertz <mertz@gnosis.cx> wrote:
What is proposed in this PEP is to add a meaning for dct1+dct2 that would be well defined, but that would be DIFFERENT from the "one obvious meaning."
For me, what's coming out is that there *is* no "obvious meaning". People expect different things. All the attempts to persuade people that they "should" expect something other than what they do is merely symptomatic of the basic fact, that not everyone expects the same thing from this operation. Whether "in time, you'll learn the meaning that Python assigns to dictionary +", and "the proposed meaning is useful in a number of contexts" are sufficiently true to counterbalance the fact that people assume different meanings when faced with the operator for the first time, is a different question - and one that's much harder to answer. But arguing over what's "obvious" in the face of people clearly stating that they have differing initial assumptions, seems like a waste of time to me. Let's just accept that the meaning of + on dictionaries, as defined by the PEP, is something that *at least some people* will not find immediately obvious, and will have to learn. Personally, I think the utility is marginal, the "obviousness" is context dependent, the inconsistencies with set union are a concern, and the fact that there are already (admittedly more convoluted) ways of doing this makes the proposal a minor win at best. So I'm probably -0 on the PEP. Paul PS Yes, every programming language construct is unfamiliar to someone completely new to programming. Yes, even keywords and method names are unfamiliar to people who are not native English speakers. Both of those points support my argument, so no-one should feel any particular need to make them here ;-)