From 41bdfa97b758e9800beeb9bb174a161e508949f1 Mon Sep 17 00:00:00 2001 From: adam-urbanczyk <13981538+adam-urbanczyk@users.noreply.github.com> Date: Thu, 8 Oct 2026 23:34:38 +0200 Subject: [PATCH] Fix mypy issue in Sketch --- cadquery/sketch.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cadquery/sketch.py b/cadquery/sketch.py index e66749053..d1db09107 100644 --- a/cadquery/sketch.py +++ b/cadquery/sketch.py @@ -988,12 +988,13 @@ def constrain( self: T, tag1: str, tag2: str, constraint: ConstraintKind, arg: Any ) -> T: + e1, e2 = self._tags[tag1][0], self._tags[tag2][0] + assert isinstance(e1, Edge), f"{tag1} is not an edge: {e1}" + assert isinstance(e2, Edge), f"{tag2} is not an edge: {e2}" + self._constraints.append( Constraint( - (tag1, tag2), - (self._tags[tag1][0], self._tags[tag2][0]), - constraint, - arg, + (tag1, tag2), (tcast(Edge, e1), tcast(Edge, e2)), constraint, arg, ) )