From 344ef173c0daeea3ef7072aabb38aa10b05e0479 Mon Sep 17 00:00:00 2001 From: Elizabeth Uselton Date: Sun, 21 Jul 2019 18:45:24 -0700 Subject: [PATCH] Revert "bpo-37555: Replacing __eq__ with == to sidestep NotImplemented" This reverts commit f295eaca5bceac6636c0e2b10e6c7d9a8ee8296a. --- Lib/unittest/mock.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index a09671a03248..c343cf4939ec 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -348,7 +348,7 @@ class _CallList(list): self_list = list(self) other_list = list(other) # checking equality both directions is necessary for ANY to work - return self_list == other_list or other_list == self_list + return self_list.__eq__(other_list) or other_list.__eq__(self_list) def _check_and_set_parent(parent, value, name, new_name): @@ -2412,8 +2412,8 @@ class _Call(tuple): self_params = self_args, self_kwargs other_params = other_args, other_kwargs return ( - self_params == other_params - or other_params == self_params + self_params.__eq__(other_params) + or other_params.__eq__(self_params) ) -- 2.47.3