We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent faa36b8 commit bb8e73fCopy full SHA for bb8e73f
Lib/test/test_functools.py
@@ -222,6 +222,26 @@ def test_repr(self):
222
[f'{name}({capture!r}, {args_repr}, {kwargs_repr})'
223
for kwargs_repr in kwargs_reprs])
224
225
+ def test_equality(self):
226
+ p = functools.partial(capture, 1, 2, a=10, b=20)
227
+ q = functools.partial(capture, 1, 2, a=10, b=20)
228
+ self.assertTrue(p == q)
229
+ self.assertFalse(p != q)
230
+ self.assertTrue(p.__eq__(q))
231
+ self.assertFalse(p.__ne__(q))
232
+
233
+ q = self.partial(capture, 1, 2, a=10)
234
+ self.assertFalse(p == q)
235
+ self.assertTrue(p != q)
236
237
+ self.assertNotEqual(p, capture)
238
+ self.assertNotEqual(q, capture)
239
240
+ a = self.partial(capture)
241
+ b = self.partial(signature)
242
+ self.assertFalse(a == b)
243
+ self.assertTrue(a != b)
244
245
def test_recursive_repr(self):
246
if self.partial in (c_functools.partial, py_functools.partial):
247
name = 'functools.partial'
0 commit comments