From 91011304236bb3aa71fdd84c1f0da757f33b97b2 Mon Sep 17 00:00:00 2001 From: Eugene Mikhantyev Date: Sun, 3 May 2026 22:00:08 +0100 Subject: [PATCH] fix: tighten _build_sch_with_instances default arg Use None default + 'instances or []' to keep mutable-default lint happy and satisfy the Iterable annotation. Co-Authored-By: Claude Opus 4.7 --- tests/test_hierarchical_pad_net_map.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_hierarchical_pad_net_map.py b/tests/test_hierarchical_pad_net_map.py index 8db04dd..2c24780 100644 --- a/tests/test_hierarchical_pad_net_map.py +++ b/tests/test_hierarchical_pad_net_map.py @@ -59,7 +59,7 @@ _SCH_EMPTY = "(kicad_sch (version 20231120))" def _build_sch_with_instances( - instances: "list[tuple[str, str, float, float, float]]" = (), + instances: "list[tuple[str, str, float, float, float]] | None" = None, ) -> str: """Build a .kicad_sch text with TestLib:R lib_symbols + the given symbol instances. @@ -70,7 +70,7 @@ def _build_sch_with_instances( the kicad-skip cache that the tests mock for labels/wires). """ parts = ["(kicad_sch (version 20231120)", _LIB_SYMBOLS_BLOCK] - for i, (ref, lib_id, x, y, rot) in enumerate(instances, start=1): + for i, (ref, lib_id, x, y, rot) in enumerate(instances or [], start=1): uuid = f"00000000-0000-0000-0000-{i:012d}" parts.append( f' (symbol (lib_id "{lib_id}") (at {x} {y} {rot}) (unit 1)\n'