summaryrefslogtreecommitdiff
path: root/python/libxml.py
diff options
context:
space:
mode:
authorMike Hommey <glandium@debian.org>2007-04-17 20:45:59 +0200
committerMike Hommey <glandium@debian.org>2007-04-17 20:45:59 +0200
commitd2e3ce393870af3b18e98e1959f0b42bd9e941ff (patch)
treeb901426fac4dc8a7c17a778823aee0c305197079 /python/libxml.py
parentb745d983af6f2b06e5fd5641acf3caccb6683695 (diff)
parent789259a1b6850d30acffbb62b11456b9ed7a8f59 (diff)
downloadlibxml2-d2e3ce393870af3b18e98e1959f0b42bd9e941ff.tar.gz
* New upstream release
Diffstat (limited to 'python/libxml.py')
-rw-r--r--python/libxml.py26
1 files changed, 18 insertions, 8 deletions
diff --git a/python/libxml.py b/python/libxml.py
index 4c9fe92..18cfad2 100644
--- a/python/libxml.py
+++ b/python/libxml.py
@@ -1,10 +1,20 @@
import libxml2mod
import types
+import sys
# The root of all libxml2 errors.
class libxmlError(Exception): pass
#
+# id() is sometimes negative ...
+#
+def pos_id(o):
+ i = id(o)
+ if (i < 0):
+ return (sys.maxint - i)
+ return i
+
+#
# Errors raised by the wrappers when some tree handling failed.
#
class treeError(libxmlError):
@@ -235,19 +245,19 @@ class xmlCore:
def __eq__(self, other):
if other == None:
- return False
+ return False
ret = libxml2mod.compareNodesEqual(self._o, other._o)
- if ret == None:
- return False
- return ret == True
+ if ret == None:
+ return False
+ return ret == True
def __ne__(self, other):
if other == None:
- return True
+ return True
ret = libxml2mod.compareNodesEqual(self._o, other._o)
- return not ret
+ return not ret
def __hash__(self):
- ret = libxml2mod.nodeHash(self._o)
- return ret
+ ret = libxml2mod.nodeHash(self._o)
+ return ret
def __str__(self):
return self.serialize()