<div><div dir="auto"><br></div></div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<a href="https://docs.python.org/3.8/library/collections.html" rel="noreferrer" target="_blank">https://docs.python.org/3.8/library/collections.html</a> has some<br>
examples using collections.Counter, which is clearly described<br>
as being a subclass of dict.  Amongst the examples:<br>
<br>
     c + d  # add two counters together:  c[x] + d[x]<br>
<br>
That's the + operator operating on two dicts (don't make me<br>
quote the Liskov Substitution Principle), but doing something<br>
really different than the base operator.<br>
<br>
So if I know that c and d (or worse, that one of them) is a<br>
dict, then interpreting c + d becomes much more interesting,</blockquote><div dir="auto"><br></div><div dir="auto">Killing a use of a common operator with a very common built in data type because the operator is used in a different way by a specialized object in the stdlib seems a bit backwards to me. </div><div dir="auto"><br></div><div dir="auto">Frankly, I think considering Counter as a dict subclass is the mistake here, even if it is true.</div><div dir="auto"><br></div><div dir="auto">-CHB</div></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Christopher Barker, PhD<br><br> Python Language Consulting<br>  - Teaching<br>  - Scientific Software Development<br>  - Desktop GUI and Web Development<br>  - wxPython, numpy, scipy, Cython<br></div>