[issue22766] collections.Counter's in-place operators should return NotImplemented for unsupported types

R. David Murray report at bugs.python.org
Thu Oct 30 18:50:23 CET 2014


R. David Murray added the comment:

'counter' in the docstrings is in lower case, so that says nothing dispositive.  However, __add__ does an ininstance check, so it is hard to see why __iadd__ does not.

Personally I'd drop the isinstance checks and let the errors bubble up as they may.  Why should subtract explicitly support other data types, but not __sub__/__isub__?  But Raymond's opinion should hold the most weight here.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22766>
_______________________________________


More information about the Python-bugs-list mailing list