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

Antoine Pitrou report at bugs.python.org
Fri Oct 31 23:35:52 CET 2014


Antoine Pitrou added the comment:

You misread that paragraph:

""" For instance, to execute the statement x += y, where x is an instance of a class that has an __iadd__() method, x.__iadd__(y) is called."""

This is the present case, and the case of most mutable containers.

"""If x is an instance of a class that does not define a __iadd__() method, x.__add__(y) and y.__radd__(x) are considered, as with the evaluation of x + y."""

This is not the present case.

----------

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


More information about the Python-bugs-list mailing list