From 5526bed4c3714594f75259483ebef5db4cd424a9 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Fri, 3 Feb 2023 21:17:08 +0100 Subject: [PATCH] Express rules: allow indexing in sets --- src/ifcopenshell-python/ifcopenshell/express/rule_compiler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/express/rule_compiler.py b/src/ifcopenshell-python/ifcopenshell/express/rule_compiler.py index 1ed05df3d0..da16e968b9 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rule_compiler.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rule_compiler.py @@ -648,7 +648,9 @@ class express_set(set): __radd__ = __add__ def __repr__(self): return repr(set(self)) - + def __getitem__(self, k): + # @todo this is obviously not stable, but should be good enough? + return list(self)[k] def typeof(inst): if not inst: