diff --git a/masque/library.py b/masque/library.py index 17f8277..6940613 100644 --- a/masque/library.py +++ b/masque/library.py @@ -336,14 +336,6 @@ class ILibraryView(Mapping[str, 'Pattern'], metaclass=ABCMeta): """ return self[self.top()] - def rename_top(self, name: str) -> Self: - """ - Rename the (single) top pattern - """ - self.rename(self.top(), name, move_references=True) - return self - - def dfs( self, pattern: 'Pattern', @@ -497,6 +489,14 @@ class ILibrary(ILibraryView, MutableMapping[str, 'Pattern'], metaclass=ABCMeta): self.move_references(old_name, new_name) return self + def rename_top(self, name: str) -> Self: + """ + Rename the (single) top pattern + """ + self.rename(self.top(), name, move_references=True) + return self + + def move_references(self, old_target: str, new_target: str) -> Self: """ Change all references pointing at `old_target` into references pointing at `new_target`.