From 98d33727a2afb39ee326f904de00afa0c4f6c23c Mon Sep 17 00:00:00 2001 From: jan Date: Thu, 12 Oct 2023 01:33:04 -0700 Subject: [PATCH] add <= operator for library (returns an Abstract) --- masque/library.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/masque/library.py b/masque/library.py index 3ed4f0b..56bf18d 100644 --- a/masque/library.py +++ b/masque/library.py @@ -651,6 +651,10 @@ class ILibrary(ILibraryView, MutableMapping[str, 'Pattern'], metaclass=ABCMeta): rename_map = self.add(other) return rename_map.get(name, name) + def __le__(self, other: Mapping[str, 'Pattern']) -> Abstract: + new_name = self << other + return self.abstract(new_name) + def dedup( self, norm_value: int = int(1e6),