<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 5, 2014, at 8:33 AM, Ethan Furman <<a href="mailto:ethan@stoneleaf.us" class="">ethan@stoneleaf.us</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: ArialMT; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I'm looking for real-world uses of collections.Counter, specifically to see if anyone has been surprised by, or had to spend extra-time debugging, issues with the in-place operators.</span></div></blockquote><br class=""></div><div>Please stop using the mailing lists as way to make an end-run around discussions on the tracker. <a href="http://bugs.python.org/issue22766" class="">http://bugs.python.org/issue22766</a> </div><div><br class=""></div><div>Also, as asked the question is a bit loaded. Effectively, it asks "has anyone ever been surprised by an exception raised by a duck-typed function or method"?</div><div><br class=""></div><div>The in-place operations on counters are duck-typed. They are intended (by design) to work with ANY type that has an items() method. The exception raised if doesn't have on is an AttributeError saying that the operand needs to have an items() method.</div><div><br class=""></div><div>I do not want to change API for already deployed code just because you would rather see a TypeError instead. Minor API changes (switching exception types) creates unnecessary consternation for users.</div><div><br class=""></div><div>Please let this one die. It seems to have become your pet project even after I've made a decision and explained my rationale.</div><div><br class=""></div><div><br class=""></div><div>Raymond</div></body></html>