From 8f70212d3b3894674004cc2e59c002911a30b398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Hees?= Date: Wed, 8 Feb 2017 19:14:30 +0100 Subject: [PATCH] cleanups wrt. str and repr --- rdflib/namespace.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rdflib/namespace.py b/rdflib/namespace.py index b954c9eb8..80735de56 100644 --- a/rdflib/namespace.py +++ b/rdflib/namespace.py @@ -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): @@ -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): @@ -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):