From e3d1ada5efb6af07b01ae280c81387c4dc383f09 Mon Sep 17 00:00:00 2001 From: liamhuber Date: Fri, 17 Jan 2025 13:58:37 -0800 Subject: [PATCH] Don't reuse variable Locally mypy doesn't care about this, but somehow on the CI it whines, even though the mypy version is allegedly the same. Signed-off-by: liamhuber --- pyiron_workflow/mixin/semantics.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyiron_workflow/mixin/semantics.py b/pyiron_workflow/mixin/semantics.py index 1ecfd8fb..5b4358e1 100644 --- a/pyiron_workflow/mixin/semantics.py +++ b/pyiron_workflow/mixin/semantics.py @@ -368,18 +368,19 @@ def _add_suffix_to_label(self, label: str) -> str: def remove_child(self, child: ChildType | str) -> ChildType: if isinstance(child, str): - child = self.children.pop(child) + child_instance = self.children.pop(child) elif isinstance(child, self.child_type()): self.children.inv.pop(child) + child_instance = child else: raise TypeError( f"{self.label} expected to remove a child of type str or " f"{self.child_type()} but got {child}" ) - child.parent = None + child_instance.parent = None - return child + return child_instance def __getstate__(self): state = super().__getstate__()