
On Fri, Oct 18, 2019 at 11:41 PM Richard Musil <risa2000x@gmail.com> wrote:
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).
Adding a time delta to a datetime isn't quite the same as adding two numbers. Adding two strings is even more different. Adding two tuples, different again. Yet they are all "adding" in a logical way. Checking if an integer is in a list isn't the same as checking if one is in a dict, and checking if a substring is in a larger string is even more different, yet, again, they are all testing for "containment". This is polymorphism. This is the normal way that Python works. What "fundamental differences" are there to be hidden? Are they not simply the nature of addition as defined by a dictionary? This is not adding ambiguity to the '+' symbol. It *always* means addition (or unary plus, but you can recognize that by the lack of left operand). ChrisA