Skip to content

Commit

Permalink
cleanups wrt. str and repr
Browse files Browse the repository at this point in the history
  • Loading branch information
joernhees authored Feb 8, 2017
1 parent 279e1d1 commit 8f70212
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rdflib/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def __getattr__(self, name):
return self.term(name)

def __repr__(self):
return "Namespace(%s)" % text_type.__repr__(self)
return "Namespace(%r)" % text_type(self)


class URIPattern(text_type):
Expand Down Expand Up @@ -150,7 +150,7 @@ def format(self, *args, **kwargs):
return URIRef(text_type.format(self, *args, **kwargs))

def __repr__(self):
return "URIPattern(%r)" % text_type.__repr__(self)
return "URIPattern(%r)" % text_type(self)


class ClosedNamespace(object):
Expand Down Expand Up @@ -185,10 +185,10 @@ def __getattr__(self, name):
return self.term(name)

def __str__(self):
return str(self.uri)
return text_type(self.uri)

def __repr__(self):
return """rdf.namespace.ClosedNamespace('%s')""" % str(self.uri)
return "rdf.namespace.ClosedNamespace(%r)" % text_type(self.uri)


class _RDFNamespace(ClosedNamespace):
Expand Down

0 comments on commit 8f70212

Please sign in to comment.