From 221d838fa6140b2799aa54feb7b136b38c2ca0f4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 17 Feb 2020 13:16:24 +0100 Subject: Support checking if Python objects with URIs are in a Nodes --- 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 2ba5c43..595ec00 100644 --- a/bindings/python/lilv.py +++ b/bindings/python/lilv.py @@ -1101,6 +1101,9 @@ class Nodes(Collection): c.nodes_free(self.collection) def __contains__(self, value): + if type(value) in [Plugin, PluginClass, UI]: + value = value.get_uri() + return c.nodes_contains(self.collection, value.node) def __len__(self): -- cgit v1.2.1