ldb/python: Support comparing Dn's to strings.
[ira/wip.git] / source / lib / ldb / ldb.i
index 2604393e8ff1b97bd10c1d3954b64e34d81456b2..560142eb6deb0822a566501d32a499cd4b642616 100644 (file)
@@ -201,6 +201,14 @@ fail:
 
         /* FIXME: implement __getslice__ */
 #endif
+    %pythoncode {
+        def __eq__(self, other):
+            if isinstance(other, self.__class__):
+                return self.__cmp__(other) == 0
+            if isinstance(other, str):
+                return str(self) == other
+            return False
+    }
     }
 } ldb_dn;