diff options
author | shreyasnagare <shreyasnagare@gmail.com> | 2021-07-01 17:18:30 -0400 |
---|---|---|
committer | shreyasnagare <shreyasnagare@gmail.com> | 2021-07-01 17:18:30 -0400 |
commit | d605a7086d80686e07252eae333d36e85723b7a3 (patch) | |
tree | 34cb310da7003056a1aea58586de919b301c2d65 | |
parent | db531bf65a7780204d670387affdb5d14fcd4d91 (diff) | |
download | rdflib-d605a7086d80686e07252eae333d36e85723b7a3.tar.gz |
Use type(self)() instead of self.__class__().
-rw-r--r-- | rdflib/graph.py | 6 |
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: |