[issue41397] Restore default implementation of __ne__ in Counter

Raymond Hettinger report at bugs.python.org
Sun Jul 26 13:14:45 EDT 2020


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> The problem is that if you subclass Counter and override 
> its __eq__ method you will need to implement also the
> __ne__ method. 

I don't think that is true.  The current code for __ne__ calls "==" and inverts the result.

Also, the docstring for the current __ne__ code is useful because it documents the effect of missing counts.  That information would be lost with the PR.

----------
assignee:  -> rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41397>
_______________________________________


More information about the Python-bugs-list mailing list