diff --git a/tksheet/row_index.py b/tksheet/row_index.py index 6e831bd..a51b878 100644 --- a/tksheet/row_index.py +++ b/tksheet/row_index.py @@ -2485,7 +2485,7 @@ def ancestors_all_open(self, iid: str, stop_at: str | Node = "") -> bool: if iid not in self.tree_open_ids: return False return True - return all(iid in self.tree_open_ids for iid in self.get_iid_ancestors(iid)) + return all(map(self.tree_open_ids.__contains__, self.get_iid_ancestors(iid))) def get_iid_ancestors(self, iid: str) -> Generator[str]: if self.tree[iid].parent: