summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshreyasnagare <shreyasnagare@gmail.com>2021-07-01 17:18:30 -0400
committershreyasnagare <shreyasnagare@gmail.com>2021-07-01 17:18:30 -0400
commitd605a7086d80686e07252eae333d36e85723b7a3 (patch)
tree34cb310da7003056a1aea58586de919b301c2d65
parentdb531bf65a7780204d670387affdb5d14fcd4d91 (diff)
downloadrdflib-d605a7086d80686e07252eae333d36e85723b7a3.tar.gz
Use type(self)() instead of self.__class__().
-rw-r--r--rdflib/graph.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/rdflib/graph.py b/rdflib/graph.py
index 8cbc066d..b01d33f8 100644
--- a/rdflib/graph.py
+++ b/rdflib/graph.py
@@ -559,7 +559,7 @@ class Graph(Node):
"""Set-theoretic union
BNode IDs are not changed."""
try:
- retval = self.__class__()
+ retval = type(self)()
except TypeError:
retval = Graph()
for (prefix, uri) in set(list(self.namespaces()) + list(other.namespaces())):
@@ -574,7 +574,7 @@ class Graph(Node):
"""Set-theoretic intersection.
BNode IDs are not changed."""
try:
- retval = self.__class__()
+ retval = type(self)()
except TypeError:
retval = Graph()
for x in other:
@@ -586,7 +586,7 @@ class Graph(Node):
"""Set-theoretic difference.
BNode IDs are not changed."""
try:
- retval = self.__class__()
+ retval = type(self)()
except TypeError:
retval = Graph()
for x in self: