1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-04 08:02:34 +03:00

Added code submitted by Andreas Pakulat to provide node equality,

* python/libxml.c, python/libxml.py, python/tests/compareNodes.py,
  python/tests/Makefile.am:
  Added code submitted by Andreas Pakulat to provide node
  equality, inequality and hash functions, plus a single
  test program to check the functions (bugs 345779 + 345961).
This commit is contained in:
William M. Brack
2006-06-26 18:25:40 +00:00
parent 631ea8176a
commit 40cca61fc1
5 changed files with 113 additions and 1 deletions

View File

@ -232,6 +232,23 @@ class xmlCore:
self._o = _obj;
return
self._o = None
def __eq__(self, other):
if other == None:
return False
ret = libxml2mod.compareNodesEqual(self._o, other._o)
if ret == None:
return False
return ret == True
def __ne__(self, other):
if other == None:
return True
ret = libxml2mod.compareNodesEqual(self._o, other._o)
return not ret
def __hash__(self):
ret = libxml2mod.nodeHash(self._o)
return ret
def __str__(self):
return self.serialize()
def get_parent(self):