Add a  __dir__ attribute to a closed namespace
This change is introduced for improved affordance when working with rdflib in interactive settings like IPython.
@@ -214,6 +214,8 @@ class ClosedNamespace(object):
def __repr__(self):
return "rdf.namespace.ClosedNamespace(%r)" % str(self.uri)
+ def __dir__(self):
+ return list(self._ClosedNamespace__uris)
class _RDFNamespace(ClosedNamespace):
"""
