From 622e64320a9d78f7aae0009360c613baaf14bb10 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Mon, 21 Sep 2015 14:23:26 +0100 Subject: [PATCH 1/2] Add __eq__ method to assertion comparison example This makes the example make more sense, because now Foo(1) == Foo(1) is true. Fixes #411 --- doc/en/assert.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/en/assert.rst b/doc/en/assert.rst index c0576ec5d..3d1a00a70 100644 --- a/doc/en/assert.rst +++ b/doc/en/assert.rst @@ -200,7 +200,10 @@ now, given this test module:: # content of test_foocompare.py class Foo: def __init__(self, val): - self.val = val + self.val = val + + def __eq__(self, other): + return self.val == other.val def test_compare(): f1 = Foo(1) From c30eafa2541c07153bb01aea356dbe812e1b4ebd Mon Sep 17 00:00:00 2001 From: Floris Bruynooghe Date: Mon, 21 Sep 2015 14:59:48 +0100 Subject: [PATCH 2/2] Update changelog for merged PR. --- CHANGELOG | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index bab682ea9..9cc6d628c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,9 +1,12 @@ -x.y.z +2.8.x ----- - Fix issue #766 by removing documentation references to distutils. Thanks Russel Winder. +- Fix issue #411: Add __eq__ method to assertion comparison example. + Thanks Ben Webb. + 2.8.0 -----------------------------