Add __eq__ method to assertion comparison example
This makes the example make more sense, because now Foo(1) == Foo(1) is true. Fixes #411
This commit is contained in:
parent
8fe5c704e3
commit
622e64320a
|
@ -202,6 +202,9 @@ now, given this test module::
|
|||
def __init__(self, val):
|
||||
self.val = val
|
||||
|
||||
def __eq__(self, other):
|
||||
return self.val == other.val
|
||||
|
||||
def test_compare():
|
||||
f1 = Foo(1)
|
||||
f2 = Foo(2)
|
||||
|
|
Loading…
Reference in New Issue