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

Elizabeth Uselton report at bugs.python.org
Wed Jul 17 11:50:53 EDT 2019


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

I feel like I agree with Paul here, unsurprising behavior from ANY is it matching anything, with no expectation that third party objects have to correctly have a return path for NotImplemented on their __eq__ method. ANY doesn't currently do that.

I've added a commit with couple other failing tests showing how using assertEqual is currently order sensitive when used with _Call or _CallList objects. I've got a work in progress fixing all three tests that just needs a little clean up, but think I might be able to lessen the complexity of it by adding Paul's idea of just special casing ANY directly, which may be smaller than the fix I have.

Thank you all for providing such great feedback so far, this is really interesting stuff to me, and a great first time submitting to Python experience so far.

----------

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


More information about the Python-bugs-list mailing list