From db0376206ca92c402f0d4f8d20c96307c41a7d02 Mon Sep 17 00:00:00 2001 From: Christopher Arndt Date: Wed, 16 Oct 2019 13:53:09 +0200 Subject: Add __add__ magic method to Python Namespace class This allows creating URIs from a Namespace instance by adding a suffix. --- bindings/python/lilv.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bindings/python') diff --git a/bindings/python/lilv.py b/bindings/python/lilv.py index 8d3674e..ffea115 100644 --- a/bindings/python/lilv.py +++ b/bindings/python/lilv.py @@ -1143,6 +1143,9 @@ class Namespace: self.world = world self.prefix = prefix + def __add__(self, suffix): + return self.world.new_uri(self.prefix + suffix) + def __eq__(self, other): return str(self) == str(other) -- cgit v1.2.1