> On Nov 5, 2014, at 8:33 AM, Ethan Furman <et...@stoneleaf.us> wrote:
> 
> 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.

Please stop using the mailing lists as way to make an end-run around 
discussions on the tracker.  http://bugs.python.org/issue22766 
<http://bugs.python.org/issue22766>   

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"?

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.

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.

Please let this one die.  It seems to have become your pet project even after 
I've made a decision and explained my rationale.


Raymond
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to