Change in vdsm[master]: mount: Implement __ne__

nsoffer at redhat.com nsoffer at redhat.com
Fri Jul 24 19:28:53 UTC 2015


Nir Soffer has uploaded a new change for review.

Change subject: mount: Implement __ne__
......................................................................

mount: Implement __ne__

There are no implied relationships among the comparison operators. The
truth of x==y does not imply that x!=y is false. Accordingly, when
defining __eq__(), one should also define __ne__() so that the operators
will behave as expected.

See https://docs.python.org/2/reference/datamodel.html#object.__eq__

Change-Id: I9b08fe7ee472c3582ee9816988db66e92c2542ea
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
---
M vdsm/storage/mount.py
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/77/43977/1

diff --git a/vdsm/storage/mount.py b/vdsm/storage/mount.py
index becd541..e818fd1 100644
--- a/vdsm/storage/mount.py
+++ b/vdsm/storage/mount.py
@@ -202,6 +202,9 @@
                 self.fs_spec == other.fs_spec and
                 self.fs_file == other.fs_file)
 
+    def __ne__(self, other):
+        return not self == other
+
     def __hash__(self):
         hsh = hash(type(self))
         hsh ^= hash(self.fs_spec)


-- 
To view, visit https://gerrit.ovirt.org/43977
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b08fe7ee472c3582ee9816988db66e92c2542ea
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>


More information about the vdsm-patches mailing list