Fix detection of namespace bindings that already exist

diff -r f4f9a560d43e rdflib/URIRef.py
--- a/rdflib/URIRef.py	Wed Jul 04 10:02:14 2007 +0200
+++ b/rdflib/URIRef.py	Wed Jul 04 10:04:14 2007 +0200
@@ -74,16 +74,6 @@ class URIRef(Identifier):
     def __getnewargs__(self):
         return (unicode(self), )
 
-
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def __eq__(self, other):
-        if isinstance(other, URIRef):
-            return unicode(self)==unicode(other)
-        else:
-            return False
-
     def __str__(self):
         return self.encode("unicode-escape")
 
diff -r f4f9a560d43e rdflib/syntax/NamespaceManager.py
--- a/rdflib/syntax/NamespaceManager.py	Wed Jul 04 10:02:14 2007 +0200
+++ b/rdflib/syntax/NamespaceManager.py	Wed Jul 04 10:04:14 2007 +0200
@@ -65,12 +65,16 @@ class NamespaceManager(object):
         return self.__cache[uri]
 
     def bind(self, prefix, namespace, override=True):
+        """ Bind prefix to namespace.
+        @param override: Override existing prefix (auto-generated prefixes are
+        overridden regardless).
+        """
         namespace = URIRef(namespace)
         # When documenting explain that override only applies in what cases
         if prefix is None:
             prefix = ''
         bound_namespace = self.store.namespace(prefix)
-        if bound_namespace and bound_namespace!=namespace:
+        if bound_namespace is not None and bound_namespace != namespace:
             # prefix already in use for different namespace
             #
             # append number to end of prefix until we find one
@@ -85,13 +89,16 @@ class NamespaceManager(object):
                 num +=1
             self.store.bind(new_prefix, namespace)
         else:
+            # Add namespace binding
             bound_prefix = self.store.prefix(namespace)
             if bound_prefix is None:
                 self.store.bind(prefix, namespace)
             elif bound_prefix == prefix:
                 pass # already bound
             else:
-                if override or bound_prefix.startswith("_"): # or a generated prefix
+                # Bound to a different prefix -- replace a generated prefix
+                # (starts with _), or any prefix if override
+                if override or bound_prefix.startswith("_"):
                     self.store.bind(prefix, namespace)
 
     def namespaces(self):
