From 482ca058bb331e5099efa1cb7f9cc69fbb126eb5 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Tue, 31 Jan 2023 22:50:10 -0800 Subject: [PATCH] add lshift operator to MutableLibrary --- masque/library.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/masque/library.py b/masque/library.py index 95945b1..615da86 100644 --- a/masque/library.py +++ b/masque/library.py @@ -587,6 +587,9 @@ class MutableLibrary(Library, MutableMapping[str, 'Pattern'], metaclass=ABCMeta) self.add(tree.library, rename_theirs=rename_theirs) return name + def __lshift__(self, other: 'Tree') -> str: + return self.add_tree(other) + def dedup( self: ML, norm_value: int = int(1e6), @@ -1031,9 +1034,6 @@ class Tree(MutableLibrary): def __delitem__(self, key: str) -> None: del self.library[key] - def __lshift__(self, other: 'Tree') -> str: - return self.add_tree(other) - def _rename_patterns(lib: Library, name: str) -> str: # TODO document rename function