[issue37555] _CallList.__contains__ doesn't always respect ANY.

Elizabeth Uselton report at bugs.python.org
Mon Jul 22 01:33:08 EDT 2019


Elizabeth Uselton <elizabeth.uselton at gmail.com> added the comment:

Serhiy, thanks for pointing that out. I generally agree with everything in that thread, and learned some new things (I had no idea count(), index() and remove() used needle on the left side!) However, I'm not trying to spearhead a rewrite of everything. I think what I'm advocating for on the two assertEqual order tests is that as Guido mentioned "people should fix their __eq__ implementation to properly return NotImplemented". _Call's __eq__ currently has no path to NotImplemented, and if it did, those tests would pass. Perhaps I should change it from the or statement to make it more clear that's what's effectively happening.

I'd like to talk more about what a good solution would be for the _Call __eq__ 
issue, since people (including myself!) have concerns, but I think it would be best to open another bug for that, and not scope creep myself. I've reverted all the commits having to do with that part so hopefully the issue with _call_matcher can get sorted separately, and then we can talk about this as it's own issue.

----------

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


More information about the Python-bugs-list mailing list