Skip to content

Commit 7c3be72

Browse files
committed
Merge pull request #1042 from Bjwebb/issue411
Add __eq__ method to assertion comparison example
2 parents 65de43e + 622e643 commit 7c3be72

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

doc/en/assert.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,10 @@ now, given this test module::
200200
# content of test_foocompare.py
201201
class Foo:
202202
def __init__(self, val):
203-
self.val = val
203+
self.val = val
204+
205+
def __eq__(self, other):
206+
return self.val == other.val
204207

205208
def test_compare():
206209
f1 = Foo(1)

0 commit comments

Comments
 (0)