[Python-ideas] adding dictionaries

Stephen J. Turnbull stephen at xemacs.org
Tue Jul 29 05:13:15 CEST 2014


Alexander Heger writes:

 > I mistyped.  It should have read " ... the behaviour in place for
 > collections.Counter"

But there *is* a *the* (ie, unique) "additive" behavior for Counter.
(At least, I find it reasonable to think so.)  What you're missing is
that there is no such agreement on what it means to add dictionaries.

True, you can "just pick one".  Python doesn't much like to do that,
though.  The problem is that on discovering that dictionaries can be
added, *everybody* is going to think that their personal application
is the obvious one to implement as "+" and/or "+=".  Some of them are
going to be wrong and write buggy code as a consequence.




More information about the Python-ideas mailing list